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 |
main() { int c[ ]={2.8,3.4,4,6.7,5}; int j,*p=c,*q=c; for(j=0;j<5;j++) { printf(" %d ",*c); ++q; } for(j=0;j<5;j++){ printf(" %d ",*p); ++p; } }
Print an integer using only putchar. Try doing it without using extra storage.
What is the match merge ? compare data step match merge with proc sql merge - how many types are there ? data step vs proc sql
code of a program in c language that ask a number and print its decremented and incremented number.. sample output: input number : 3 321123
Set up procedure for generating a wire frame display of a polyhedron with the hidden edges of the object drawn with dashed lines
main() { int i=5,j=6,z; printf("%d",i+++j); }
Write a program to print a square of size 5 by using the character S.
main() { struct date; struct student { char name[30]; struct date dob; }stud; struct date { int day,month,year; }; scanf("%s%d%d%d", stud.rollno, &student.dob.day, &student.dob.month, &student.dob.year); }
main() { signed int bit=512, i=5; for(;i;i--) { printf("%d\n", bit = (bit >> (i - (i -1)))); } } a. 512, 256, 128, 64, 32 b. 256, 128, 64, 32, 16 c. 128, 64, 32, 16, 8 d. 64, 32, 16, 8, 4
main() { extern int i; i=20; printf("%d",i); }
Develop a routine to reflect an object about an arbitrarily selected plane
Write a C function to search a number in the given list of numbers. donot use printf and scanf