C Languages Interview Questions

21. What is the difference between getch() and getche()?
 
  • Integer data type allows a variable to store numeric values. The storage size of int data type is 2 or 4 or 8 byte. It varies depend upon the processor in the CPU.
  • Character data type allows a variable to store only one character. Storage size of character data type is 1.
  • Float data type allows a variable to store decimal values. Storage size of float data type is 4. This also varies depend upon the processor in the CP.
  • Double data type is also same as float data type which allows up to 10 digits after decimal.
 
Your Name Your Email-ID
Your Answer
22. What is the difference between printf(), sprintf() and fprintf()?
 
  • printf() is used to print the text or value of the variable in the screen.
  • sprintf() is used to store the values in the character array or string.
  • fprintf() is used to store the values of variable in the file.
 
Your Name Your Email-ID
Your Answer
23. What is the difference between scanf() and gets() function?
 
  • In scanf() when there is a blank was typed, the scanf() assumes that it is an end.
  • gets() assumes the enter key as end.
 
Your Name Your Email-ID
Your Answer
24. What is a syntax error?
 
  • Syntax errors are associated with mistakes in the use of a programming language.
  • It may be a command that was misspelled or a command that must was entered in lowercase mode but was instead entered with an upper case character.
  • A misplaced symbol or lack of symbol, somewhere within a line of code can also lead to syntax error.
 
Your Name Your Email-ID
Your Answer
123456789101112


131415 Page 6 of 15