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 is chain pointer in c?
What is union and structure in c?
‘SAVEPOINT’ and ‘ROLLBACK’ is used in oracle database to secure the data comment. Give suitable examples of each with sql command.
Is this program statement valid? INT = 10.50;
a simple program in c language
Can variables be declared anywhere in c?
wat is the output int main() { char s1[]="Hello"; char s2[]="Hello"; if(s1==s2) printf("Same"); else printf("Diff"); }
What will be the result of the following program? main() { char p[]="String"; int x=0; if(p=="String") { printf("Pass 1"); if(p[sizeof(p)-2]=='g') printf("Pass 2"); else printf("Fail 2"); } else { printf("Fail 1"); if(p[sizeof(p)-2]=='g') printf("Pass 2"); else printf("Fail 2"); } } a) Pass 1, Pass 2 b) Fail 1, Fail 2 c) Pass 1, Fail 2 d) Fail 1, Pass 2 e) syntax error during compilation
Find the middle node in the linked list?? (Note:Do not use for loop, count and count/2)
True or false: If you continuously increment a variable, it will become negative? 1) True 2) False 3) It depends on the variable type
cavium networks written test pattern ..
please give me some tips for the selection in TCS.