Protection Status

Getchar() function in C || C Programs

Code -

#include <stdio.h> 
#include <conio.h>     
void main()  
 char c;   
    printf ("\n Enter a character \n");  
    c = getchar(); // get a single character 
    printf(" You have passed ");  
    putchar(c); // print a single character using putchar 

Output -

Enter a character
 You have passed A
13 views0 comments

Related Posts

See All

Program of Random Number in C || C Programs

Code - #include <stdio.h> #include <conio.h> #include <stdlib.h> void main() { // use rand() function to generate the number printf (" The random number is: %d", rand()); pri

GCD of two numbers in C || C Programs

Code - #include <stdio.h> #include <conio.h> int main() { // declare the variables int n1, n2, i, GCD_Num; printf ( " Enter any two numbers: \n "); scanf ( "%d %d", &n1, &n2);

  • Facebook
  • Instagram
  • LinkedIn
  • 1024px-Telegram_logo.svg
  • download
  • YouTube
  • Google Play