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 |
Write a program to implement the motion of a bouncing ball using a downward gravitational force and a ground-plane friction force. Initially the ball is to be projected in to space with a given velocity vector
what is the code of the output of print the 10 fibonacci number series
String copy logic in one line.
What is the subtle error in the following code segment? void fun(int n, int arr[]) { int *p=0; int i=0; while(i++<n) p = &arr[i]; *p = 0; }
why java is platform independent?
What is the output for the following program main() { int arr2D[3][3]; printf("%d\n", ((arr2D==* arr2D)&&(* arr2D == arr2D[0])) ); }
main() { int i =0;j=0; if(i && j++) printf("%d..%d",i++,j); printf("%d..%d,i,j); }
write a program to Insert in a sorted list
How we print the table of 3 using for loop in c programing?
#include<stdio.h> void fun(int); int main() { int a; a=3; fun(a); printf("\n"); return 0; } void fun(int i) { if(n>0) { fun(--n); printf("%d",n); fun(--n); } } the answer is 0 1 2 0..someone explain how the code is executed..?
int aaa() {printf(“Hi”);} int bbb(){printf(“hello”);} iny ccc(){printf(“bye”);} main() { int ( * ptr[3]) (); ptr[0] = aaa; ptr[1] = bbb; ptr[2] =ccc; ptr[2](); }
Is the following code legal? typedef struct a { int x; aType *b; }aType