Question 67: Input several lines of text from the keyboard, each line ends with a carriage return, and ctrl+z is used as the input terminator, and the number of lines is counted.
#include “stdio.h”
#include “stdlib.h”
#include “conio.h”
int main()
{
int c,num=0;
while(1)
{
c=getche();
if (c13)
{
printf("\n");
num++;
}
if(c26)
{ printf("\nYou entered %d line\n",++num); exit(1); } } }