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().
Answers were Sorted based on User's Feedback
Answer / aditya lele
It does not return an error .
the output would be
x=9, y=9x=9, count of earlier print=8
HINT: try and understand the way printf evaluation works (right to left or left to right), also keep in mind when printf is called and what argument values are passed and when exactly is the data written to STDOUT
| Is This Answer Correct ? | 3 Yes | 0 No |
Answer / aditya lele
By the way the error that you are talking about is because
of the fact that your function has an integer return type
and you are not returning anything.
add a
return 0;
at the end before you close the main()
| Is This Answer Correct ? | 1 Yes | 1 No |
int i=10; main() { extern int i; { int i=20; { const volatile unsigned i=30; printf("%d",i); } printf("%d",i); } printf("%d",i); }
how to return a multiple value from a function?
main() { char *p="hai friends",*p1; p1=p; while(*p!='\0') ++*p++; printf("%s %s",p,p1); }
void main() { char ch; for(ch=0;ch<=127;ch++) printf(ā%c %d \nā, ch, ch); }
Develop a routine to reflect an object about an arbitrarily selected plane
#define int char main() { int i=65; printf("sizeof(i)=%d",sizeof(i)); }
void main() { int i=5; printf("%d",i+++++i); }
main(){ unsigned int i; for(i=1;i>-2;i--) printf("c aptitude"); }
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.
how many processes will gate created execution of -------- fork(); fork(); fork(); -------- Please Explain... Thanks in advance..!
Write a c program to search an element in an array using recursion
There are 21 people in a room. They have to form groups of 3 people each. How many combinations are possible? Write a C program to print the same.