what is the output of the below program & why ?
#include<stdio.h>
void main()
{
int a=10,b=20,c=30;
printf("%d",scanf("%d%d%d",&a,&b,&c));
}
Answers were Sorted based on User's Feedback
Answer / gaurav sharma
because printf returns the number of printed arguments .here
3 arguments taken ,the concept is ( scanf also return the
number of arguments so 3 returned to printf .m gaurav
sharma ,,,,,works in aricent.
Is This Answer Correct ? | 8 Yes | 0 No |
Answer / vibekananda dash
dear selvam,
its showing o/p,
its ask for entry and it accept ur entry,
o/p is -
i entered
1
press enter 2
press enter 78
press enter 3.
my question is why its showing 3.
Is This Answer Correct ? | 4 Yes | 0 No |
Answer / kalyani
The answer is 3 because scanf returns no of arguments
Is This Answer Correct ? | 5 Yes | 1 No |
for Gcc compiler the code is producing error infact DevC++ just crashed . But using ANSI turbo C++ Ans is 3 ,
As the number of parameters in the printf() function is 3
Is This Answer Correct ? | 1 Yes | 0 No |
Answer / selvam
this program contain no error and it will not give any output...
Is This Answer Correct ? | 4 Yes | 5 No |
Is it possible to type a name in command line without ant quotes?
What is the hidden bug with the following statement? assert(val++ != 0);
#include<stdio.h> main() { struct xx { int x; struct yy { char s; struct xx *p; }; struct yy *q; }; }
How will u find whether a linked list has a loop or not?
main() { printf("%d, %d", sizeof('c'), sizeof(100)); } a. 2, 2 b. 2, 100 c. 4, 100 d. 4, 4
18 Answers HCL, IBM, Infosys, LG Soft, Satyam,
print numbers till we want without using loops or condition statements like specifically(for,do while, while swiches, if etc)!
Write a C program that defines a 2-dimentional integer array called A [50][50]. Then the elements of this array should randomly be initialized either to 1 or 0. The program should then print out all the elements in the diagonal (i.e. a[0][0], a[1][1],a[2][2], a[3][3], ……..a[49][49]). Finally, print out how many zeros and ones in the diagonal.
what will be the output of this program? void main() { int a[]={5,10,15}; int i=0,num; num=a[++i] + ++i +(++i); printf("%d",num); }
main() { int a[10]; printf("%d",*a+1-*a+3); }
Give a one-line C expression to test whether a number is a power of 2.
Given an array of characters which form a sentence of words, give an efficient algorithm to reverse the order of the words (not characters) in it.
plz send me all data structure related programs