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 |
main() { signed int bit=512, i=5; for(;i;i--) { printf("%d\n", bit >> (i - (i -1))); } } a. 512, 256, 0, 0, 0 b. 256, 256, 0, 0, 0 c. 512, 512, 512, 512, 512 d. 256, 256, 256, 256, 256
void main() { int x,y=2,z; z=(z*=2)+(x=y=z); printf("%d",z); }
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.
#include <stdio.h> #define a 10 main() { #define a 50 printf("%d",a); }
main() { char a[4]="HELLO"; printf("%s",a); }
main(){ int a= 0;int b = 20;char x =1;char y =10; if(a,b,x,y) printf("hello"); }
write a program in c language to get the value of arroy keys pressed and display the message which arrow key is pressed?
Is the following code legal? struct a { int x; struct a *b; }
int main() { int x=10; printf("x=%d, count of earlier print=%d", x,printf("x=%d, y=%d",x,--x)); getch(); } ================================================== returns error>> ld returned 1 exit status =================================================== Does it have something to do with printf() inside another printf().
Hi, i have a project that the teacher want a pyramid of numbers in C# or java...when we click a button...the pyramid should be generated in a listbox/or JtextArea...and the pyramid should have the folowing form: 1 232 34543 4567654 567898765 67890109876 7890123210987 890123454321098 90123456765432109 0123456789876543210 Plz help with codes...didn't find anything on the net.
#ifdef something int some=0; #endif main() { int thing = 0; printf("%d %d\n", some ,thing); }
Write a routine to draw a circle (x ** 2 + y ** 2 = r ** 2) without making use of any floating point computations at all.
2 Answers Mentor Graphics, Microsoft,