Tuesday 10 July 2012

Program to hold the output till Enter Key is pressed in C


Code - 



/* Program to hold the output till Enter Key is pressed */

/* Logic - ASCII value of Enter Key is 13 and compare the input character with 13.

   If the character inputted in 13 then come out of the loop else loop continues */

//__ Including Header Files __

#include<stdio.h>

#include<conio.h>

int main()
{
printf("\n\n\t __ Program to hold the output till enter key is pressed __");

printf("\n\n\n\t\t  Press \" Enter key \" to end the Program ...");

while(getch() != 13) //__ Comparing ASCII Value ___
{
}

return 0;
}

Follow Us on Facebook - Assignment Hub

No comments:

Post a Comment