C Programming Question and Answers

37. How will you print "Hello World" without semicolon?
  int main (void)
{
if (printf("Hello World"));
}
 
Your Name Your Email-ID
Your Answer
38. Can the "if" function be used in comparing strings?
  No. " if"command can only be used to compare numerical values and single character values. For comparing string values, there is another function called strcmp that deals specifically with strings.
 
Your Name Your Email-ID
Your Answer
39. What is the difference between text files and binary files?
  Text files contain data that can easily be understood by humans. It includes letters, number and other characters. On the other hand, binary files contain 1s and 0s that only computers can interpret.
 
Your Name Your Email-ID
Your Answer
40. What is the difference between printf and cprintf?
 
  • printf outputs to the standard output stream (stdout)
  • fprintf goes to a file handle (FILE)
  • sprintf goes to a buffer you allocated. (char *).
 
Your Name Your Email-ID
Your Answer
123456789101112


131415 Page 10 of 15