what is the output on the screen?

int n;
n=printf("my name is %d",printf("kiran %d",printf("kumar")));
printf("\n %d \n",n);

Answers were Sorted based on User's Feedback



what is the output on the screen? int n; n=printf("my name is %d",printf("kiran %..

Answer / raghav

hi the answer is bit scribbling
answer is
kumar kiran 5my name is 7/n12/n

Is This Answer Correct ?    8 Yes 3 No

what is the output on the screen? int n; n=printf("my name is %d",printf("kiran %..

Answer / nish

kumarkiran 5my name is 7
n=12

Is This Answer Correct ?    1 Yes 1 No

what is the output on the screen? int n; n=printf("my name is %d",printf("kiran %..

Answer / krishnachaitanya

n is 12.
because every printf() statement returns an integer value.
in the above code i.e printf("my name is %d",printf("kiran
%d",printf("kumar")));
kiran returns 5
the correct ans is
kumarkiran5 my name is 6
n=12

Is This Answer Correct ?    2 Yes 4 No

what is the output on the screen? int n; n=printf("my name is %d",printf("kiran %..

Answer / kirankumaryakkala

see the printf defination at stdio.h

its, int printf(const char *,...)
//printf returns no of charecters written to the screen
// and ... represents variable no of arguments
//now every printf returns one integer corresponding to the
no of charecters written on the screen.

its simple , now u can guess
try it.

Is This Answer Correct ?    1 Yes 7 No

Post New Answer

More C Interview Questions

Can you please explain the difference between malloc() and calloc() function?

0 Answers  


What is the size of enum in c?

0 Answers  


How will you divide two numbers in a MACRO?

0 Answers   Apps Associates,


write a program to swap Two numbers without using temp variable.

75 Answers   EMC, Focus, GreyB, HCL, Hitech, HP, Huawei, Infosys, Mannar Company, Microsoft, Miles Software, Odessa Technologies, Satyam, TCS, Wipro,


how to print "hai" in c?

13 Answers   TCS,






write a c/c++ programthat connects to a MYSQL server and checks if the INNoDB plug in is installed on it.If so your program should print the total number of disk writes by MYSQL.

0 Answers   BirlaSoft,


What is string constants?

0 Answers  


What is meant by high-order and low-order bytes?

0 Answers  


what is the difference between auto and static keywords

1 Answers   cDot, College School Exams Tests, TCS,


if the address of a[1,1] and a[2,1] are 1000 and 1010 respectively and each occupies 2 bytes then the array has been stored in what order?

4 Answers   Amazon, Apple, Bata, Google, NASA,


Are the outer parentheses in return statements really optional?

0 Answers  


write a programming in c language, 1 3 5 7 9 11

2 Answers   NIIT,


Categories