What the scanf function do?what is the output for
if(scanf("%d",&i)==1)//input value is 10
{
printf("hi");
}
else
{
printf("bye");
}

Answers were Sorted based on User's Feedback



What the scanf function do?what is the output for if(scanf("%d",&i)==1)//input value ..

Answer / santhi

bye

Is This Answer Correct ?    8 Yes 3 No

What the scanf function do?what is the output for if(scanf("%d",&i)==1)//input value ..

Answer / vishal pitaliya

in case of integer value scanf function
return
1 if value is +ve
0 if negative

so 10 is +ve it would return 1

and in the if statement it will compare with another value
specied in the if statement .
so condition is true 1==1
so output is hi
THANK YOU.........

Is This Answer Correct ?    1 Yes 0 No

What the scanf function do?what is the output for if(scanf("%d",&i)==1)//input value ..

Answer / harshitha

scanf function stores the value in a particular address.
and the output for the above program is "bye".

Is This Answer Correct ?    2 Yes 2 No

What the scanf function do?what is the output for if(scanf("%d",&i)==1)//input value ..

Answer / arvind

scanf is a standard input function in "C" language. help of
this function we input values. the ans. of avove if
statement is bye

Is This Answer Correct ?    1 Yes 1 No

What the scanf function do?what is the output for if(scanf("%d",&i)==1)//input value ..

Answer / srinivas

Ans: hi

Description:scanf() return number of succesful reading from
STDIN.in this case 1 input read from console.

Is This Answer Correct ?    1 Yes 4 No

Post New Answer

More English Interview Questions

how effective communication can be made ?

2 Answers  


plz,give me previous five years sbi clerical question paper

4 Answers   IBM, PDF, State Bank Of India SBI,


Sir,plz tell me what topics to prepare for the mangerial aptitude for office under trianee general exam.sir,plz send me as soon as possible 2 my mail-id.My id z:rayudu.lph@gmail.com

0 Answers   APSRTC,


Of the 45 students that Jason surveyed, 36 of them like chocolate. if jason were to survey 100 students, how many of them could he expect to like chocolate?

4 Answers  


can anybody tell what may be the cut off mark for the APPSC Group-1 prelims Exam held on sep 5 2010

2 Answers   TCS,


SSC ? Grade ?D? Exam ENGLISH CLOSET TEST TEST-6

1 Answers  


which one is correct and why - 900 Litre or Litres

8 Answers   RRB,


How can we measure the pH of Hydrogen gas?

2 Answers   Alchem, Lupin,


Logical appitude

0 Answers   IonIdea,


Mention any two learner factors in second language acquisition.

0 Answers   Mahatma Gandhi University,


how do you identify your self?

0 Answers  


in 25 words explain what you understand to be the difference between administrative [immigration] detention and correctional imprisonment.

0 Answers  


Categories