what is the output of
printf("%d",(scanf("%d",10));

Answers were Sorted based on User's Feedback



what is the output of printf("%d",(scanf("%d",10));..

Answer / ansh

This code when executes on a Turbo C compiler requires an
input from user and is giving 1 as output if one enters a
numeral value and 0 otherwise.

Is This Answer Correct ?    18 Yes 7 No

what is the output of printf("%d",(scanf("%d",10));..

Answer / kamal

scanf() returns integer value for number sucessful entry taken.
Due to this cause of taking integer value at address 10 it
will print 1 otherwise 0;

Is This Answer Correct ?    11 Yes 2 No

what is the output of printf("%d",(scanf("%d",10));..

Answer / ravinder singh rawat

scanf returns nos. of arguments taken by scanf hence it
will ask user to input and if integer is fed as I/P then
printf gives 1 as o/p

Is This Answer Correct ?    4 Yes 1 No

what is the output of printf("%d",(scanf("%d",10));..

Answer / hema

In Unix enviroment, this gives warning while compilation
and core when executed with a user value. Since scanf
expects a variable( address) to store the value, whereas
here we are assinging value to constant.

Is This Answer Correct ?    1 Yes 0 No

what is the output of printf("%d",(scanf("%d",10));..

Answer / umesh

#include<stdio.h>
int main ()
{
int c;
printf("%d",(scanf("%d",&c)));
return 0;
}

in this case return 1 instead of entering any value as input.


printf("%d",(scanf("%d",10)));
in this case simply generates a run time error. bcoz Since scanf always expects a variable( address) to store the value.

Is This Answer Correct ?    2 Yes 1 No

what is the output of printf("%d",(scanf("%d",10));..

Answer / arti

tihis will return an runtime error as no address is pass in
scanf where value is to assign which we get as user input
through scanf().

Is This Answer Correct ?    3 Yes 3 No

what is the output of printf("%d",(scanf("%d",10));..

Answer / kalyan chukka

Answer is 1 Because it prints how many values taken from
keyboard so it prints 1

Is This Answer Correct ?    3 Yes 3 No

what is the output of printf("%d",(scanf("%d",10));..

Answer / neelamani

1 NULL pointer assignment

This output in TC compiler

Is This Answer Correct ?    5 Yes 6 No

what is the output of printf("%d",(scanf("%d",10));..

Answer / karna

answer is 1.because it counts how many numbers are given as input

Is This Answer Correct ?    1 Yes 3 No

what is the output of printf("%d",(scanf("%d",10));..

Answer / makadivya

10

Is This Answer Correct ?    14 Yes 22 No

Post New Answer

More C Interview Questions

#define MAX 3 main() { printf("MAX = %d ",MAX ); #undef MAX #ifdef MAX printf("Vector Institute”); #endif }

1 Answers   Vector India,


Explain #pragma statements.

0 Answers  


What do the functions atoi(), itoa() and gcvt() do?

0 Answers   Aspire, Infogain,


Why is c called a structured programming language?

0 Answers  


What is your favorite subject?

1 Answers   Ericsson, Invendis, Tech Mahindra,


what does the following code do? fn(int n,int p,int r) { static int a=p; switch(n){ case 4:a+=a*r; case 3:a+=a*r; case 2:a+=a*r; case 1:a+=a*r; } } a.computes simple interest for one year b.computes amount on compound interest for 1 to 4 years c.computes simple interest for four year d.computes compound interst for 1 year

7 Answers   TCS,


What is extern variable in c with example?

0 Answers  


please send me the code for multiplying sparse matrix using c

0 Answers  


What are the main characteristics of c language describe the structure of ac program?

0 Answers  


Where does the name "C" come from, anyway?

0 Answers   Celstream,


Using functions, write a program that multiplies two arrays. Use the following functions: - Function ReadArray - Function MultiplyArrays - Function DisplayArrays

0 Answers  


What is the argument of a function in c?

0 Answers  


Categories