Right Click to Search

Wednesday, January 27, 2025

Getche function >> conio.h Header file >> Library Functions in C Programming






Getche function >> conio.h Header file >> Library Functions in C Programming

What it does :
  1. Getche accepts character from console
  2. Character accepted  echoes to the screen [ displayed on screen ]
  3. Header File : conio.h
int getche(void);

Live Examples :

  #include"stdio.h"
  #include"conio.h"
  void main(void)
  {
     char ch;
     printf("Input a character:");
     ch = getche();
     printf("\nYou input a '%c'\n", ch);
  }


Output :
You input a 'x'

Ways of Using getche function :

Way 1 : To Loop back
void main()
{
 char ch;
 do 
  {
      printf("You are in Do while Loop ");
       printf("Do you want to continue , Y to continue , N to quit ");
       ch = getche();
  }while(ch!='N');
}

Bookmark & Share

Tags / Keywords : | ,

Stumble
Delicious
Technorati
Twitter
Facebook

0 Comments:

Post a Comment

Your Feedback :This is Growing Site and Your Feedback is important for Us to improve the Site performance & Quality of Content.Feel Free to contact and Please Provide Name & Contact Email

 

Learn C Programming Copyright © 2010 LKart Theme is Designed by Lasantha, Free Blogger Templates