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 |
Write a c program to search an element in an array using recursion
main() { int i=5; printf(ā%dā,i=++i ==6); }
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.
Find the largest number in a binary tree
main() { extern int i; i=20; printf("%d",sizeof(i)); }
main() { char *a = "Hello "; char *b = "World"; clrscr(); printf("%s", strcat(a,b)); } a. Hello b. Hello World c. HelloWorld d. None of the above
C statement to copy a string without using loop and library function..
main() { char string[]="Hello World"; display(string); } void display(char *string) { printf("%s",string); }
main(){ unsigned int i; for(i=1;i>-2;i--) printf("c aptitude"); }
main() { char *p; p="Hello"; printf("%c\n",*&*p); }
programming in c lanugaue programm will errror error with two header file one as stdio.h and other one is conio.h
void main() { char far *farther,*farthest; printf("%d..%d",sizeof(farther),sizeof(farthest)); }