as

Tuesday, 11 November 2014

C Basic Syntax


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
  1. %d :- specifier to display the value of an integer variable.
  2. %c :- Used to display character,
  3. %f :- Used to display float variable.
  4. %s :- Used to display string variable.
  5. %lf :- Used to display double variable.
  6. %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.
  1. Each statement should end with semicolon.
  2. C Program source file has an extension .c
  3. 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.

Sponsored Links

Popular Posts

Comments

ShareThis