C Programming Interview / Viva Q&A: 2


This C program has a integer variable and 2 printf functions. Check the source code below and guess the output.

Whats the output of this C Program?

  1.    
  2. #include < stdio.h >  
  3.   
  4. int main()  
  5. {  
  6.     int a;  
  7.   
  8.     a = printf("IBM");  
  9.   
  10.     printf("\n%d", a);  
  11.   
  12.     return 0;  
  13. }  

Output 1:
IBM
3

Output 2:
Microsoft
9

Output 3:
Apple
5

Output 4:
Oracle
6

C Programming Interview / Viva Q&A: 2 (printf)



YouTube Link: https://www.youtube.com/watch?v=e9gZ9Vk8lf4 [Watch the Video In Full Screen.]


Important: printf() function returns the number of characters printed by it.

For list of all c programming interviews / viva question and answers visit: C Programming Interview / Viva Q&A List

For full C programming language free video tutorial list visit:C Programming: Beginner To Advance To Expert

Leave a Reply

Your email address will not be published. Required fields are marked *