I want to convert this C program to C#
Hello gurus on forum I was wondering if ya could help me I'm wanting to convert this c program to c#
Code:
#include <stdio.h>
#include <stdlib.h>
int main()
{
int ch;
int num_chars = 0;
int num_lines = 0;
printf("\nThis program counts the number of characters");
printf("\nyou enter on each input line and outputs the");
printf("\ntotal number of characters and lines entered.");
printf("\Terminate each line with Enter. Terminate the");
printf("\nprogram by pressing Enter [Ctrl]+Z, and Enter.\n\n");
while((ch = getchar()) != EOF)
{
num_lines++;
do
{
num_chars++;
}while((ch = getchar()) != '\n');
}
printf("\You entered %d characters and %d lines.\n\n",num_chars,num_lines);
system("PAUSE");
return 0;
}
I just can't figure out how to do it
Excuse the system call I know I'm suppose to use getch()