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() { unsigned int i=10; while(i-->=0) printf("%u ",i); }
program to Reverse a linked list
12 Answers Aricent, Microsoft, Ness Technologies,
main( ) { int a[2][3][2] = {{{2,4},{7,8},{3,4}},{{2,2},{2,3},{3,4}}}; printf(ā%u %u %u %d \nā,a,*a,**a,***a); printf(ā%u %u %u %d \nā,a+1,*a+1,**a+1,***a+1); }
main() { int *j; { int i=10; j=&i; } printf("%d",*j); }
main() { float me = 1.1; double you = 1.1; if(me==you) printf("I love U"); else printf("I hate U"); }
how to test pierrot divisor
write a c program to Create employee record by taking details like name, employee id, address and phone number. While taking the phone number, take either landline or mobile number. Ensure that the phone numbers of the employee are unique. Also display all the details
Finding a number which was log of base 2
Write a program to print a square of size 5 by using the character S.
typedef struct error{int warning, error, exception;}error; main() { error g1; g1.error =1; printf("%d",g1.error); }
main() { int y; scanf("%d",&y); // input given is 2000 if( (y%4==0 && y%100 != 0) || y%100 == 0 ) printf("%d is a leap year"); else printf("%d is not a leap year"); }
main() { int i; float *pf; pf = (float *)&i; *pf = 100.00; printf("\n %d", i); } a. Runtime error. b. 100 c. Some Integer not 100 d. None of the above