what is printf() and scanf () roll in C language ? printf() and scanf() functions are inbuilt library functions in C programming language which are available in C library by default. These functions are declared and related macros are defined in “stdio.h” which is a header file in C language. We have to include “stdio.h” file as shown in below C program to make use of these printf() and scanf() library functions in C language. printf() and scanf() are basic function of C language.
#include<stdio.h> #include<conio.h> void main() { int age; clrscr(); printf("enter your age to check you are elizable for voting or not="); scanf("%d",&age); if(age>18) { printf("%d you are elizable", age); } else { printf("you are not elizable for vote",age); } getch(); }
Comments
Post a Comment