what is the output of
printf("%d",(scanf("%d",10));
Answers were Sorted based on User's Feedback
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 |
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 |
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 |
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 |
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 |
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 |
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 |
Answer / neelamani
1 NULL pointer assignment
This output in TC compiler
Is This Answer Correct ? | 5 Yes | 6 No |
Answer / karna
answer is 1.because it counts how many numbers are given as input
Is This Answer Correct ? | 1 Yes | 3 No |
what are bit fields? What is the use of bit fields in a structure declaration?
0 Answers Flextronics, TISL, Virtusa,
please help me.. how to write a code of this output?? "Enter range number:"10 1 is an odd number 2 is an even numbers 3 in an odd numbers 4 " to 10" "printing all odd numbers:" 1,3,5,7,9 "printing all even numbers:" 2,4,6,8,10 "sum of all odd numbers:25 "sum of all even numbers:30 using a C Programming ARRAY pleas pleas help.. its my project ..please :(
how do you programme Carrier Sense Multiple Access
Can a variable be both const and volatile?
How can I remove the trailing spaces from a string?
What is the output of the following program main();{printf ("chennai""superkings"}; a. Chennai b. superkings c. error d. Chennai superkings
What is volatile variable in c with example?
Why the use of alloca() is discouraged?
What is switch in c?
Describe the complexity of Binary search, Quicksort and various other sorting and searching techniques..
A float occupies 4 bytes in memory. How many bits are used to store exponent part? since we can have up to 38 number for exponent so 2 ki power 6 6, 6 bits will be used. If 6 bits are used why do not we have up to 64 numbers in exponent?
write a program that declares an array of 30 elements named "income" in the main functions. then cal and pass the array to a programmer-defined function named "getIncome" within the "getIncome" function, ask the user for annual income of 30 employees. then calculate and print total income on the screen using the following function: "void getIncome ( ai []);