1. scanf
scanf के जरिये numeric, characters और string कोई भी value input किया जाता है |
scanf को program में इस्तेमाल करने के लिए stdio.h ये header file include करनी पडती है |
int a;
scanf("%d",&a );
2. printf
printf data को screen पर write करने के लिए इस्तेमाल किया जाता है |
printf को program में इस्तेमाल करने के लिए stdio.h ये header file include करनी पडती है |
printf("Hello World !");3. getchar(Input) and putchar(Output)
(for single character)
getchar का इस्तेमाल user से input मतलब एक character लेने की अनुमति ली जाती है |अगर user ने एक से ज्यादा character input में दे दिए तो putchar पहले एक ही character को output में print करता है |
#include <stdio.h>
int main( ) {
int i;
printf( "Enter a character :");
i = getchar();
printf( "Entered character is : ");
putchar(i);
return 0;
}Output :
Enter a character :Malik Entered character is : M
4. gets() and puts() (for string)
#include <stdio.h>
int main(){
char name[20];
printf( "Enter your name : \n");
gets(name);
printf( "You name is : ");
puts(name);
return 0;
}Output :
Enter your name : Rajasthan Your name is : Rajasthan
