printf() and scanf() functions are in-built library
functions in C 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.
printf() function is used to print the “character, string,
float, integer, octal and hexadecimal values” onto the output screen. We use
printf() function with below formats
- %d :- specifier to display the value of an integer variable.
- %c :- Used to display character,
- %f :- Used to display float variable.
- %s :- Used to display string variable.
- %lf :- Used to display double variable.
- %x :- Used to display hexadecimal variable.
scanf() function is used to read character, string, numeric
data from keyboard.
Please remember below points about C programs.
- Each statement should end with semicolon.
- C Program source file has an extension .c
- We can use {} braces to group the statements in C.
No comments:
Post a Comment
Leave your valuable feedback. Your thoughts do matter to us.