why is printf("%d %d %d",i++,--i,i--);
Answers were Sorted based on User's Feedback
Answer / rick g
if: i = (-1)
-1, -1, -1
(1) Print '-1', then post-increment i. i is now 0.
(2) Pre-decrement i. i is now back to -1. Print '-1'
(3) Print '-1', then post-decrement i. i is now -2
| Is This Answer Correct ? | 2 Yes | 0 No |
main() { int i=-1; +i; printf("i = %d, +i = %d \n",i,+i); }
Write a program to implement the motion of a bouncing ball using a downward gravitational force and a ground-plane friction force. Initially the ball is to be projected in to space with a given velocity vector
Is the following code legal? typedef struct a { int x; aType *b; }aType
what will be the position of the file marker? a: fseek(ptr,0,SEEK_SET); b: fseek(ptr,0,SEEK_CUR);
main( ) { char *q; int j; for (j=0; j<3; j++) scanf(“%s” ,(q+j)); for (j=0; j<3; j++) printf(“%c” ,*(q+j)); for (j=0; j<3; j++) printf(“%s” ,(q+j)); }
Is the following code legal? void main() { typedef struct a aType; aType someVariable; struct a { int x; aType *b; }; }
func(a,b) int a,b; { return( a= (a==b) ); } main() { int process(),func(); printf("The value of process is %d !\n ",process(func,3,6)); } process(pf,val1,val2) int (*pf) (); int val1,val2; { return((*pf) (val1,val2)); }
How we print the table of 2 using for loop in c programing?
Write a program that produces these three columns sequence nos. using loop statement Sequence nos. Squared Squared + 5 1 1 6 2 4 9 3 9 14 4 16 21 5 25 30
write a c program to Create a registration form application by taking the details like username, address, phone number, email along with password and confirm password (should be same as password).Ensure that the password is of 8 characters with only numbers and alphabets. Take such details for 5 users and display the details. In place of password display “****”. (Use Structures).
0 Answers CDAC, College School Exams Tests,
How to read a directory in a C program?
What is wrong with the following code? int *foo() { int *s = malloc(sizeof(int)100); assert(s != NULL); return s; }