main()
{
char *p = “ayqm”;
printf(“%c”,++*(p++));
}
Answers were Sorted based on User's Feedback
Answer / ravneet kaur
as *p has address of a.and after increment p++ it moves to
y and after ++*(p++) its address is incremented and gets the
another location and gets the value z and value of memory
location is any other value.
| Is This Answer Correct ? | 6 Yes | 14 No |
void main() { void *v; int integer=2; int *i=&integer; v=i; printf("%d",(int*)*v); }
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.
Derive expression for converting RGB color parameters to HSV values
main() { printf("\nab"); printf("\bsi"); printf("\rha"); }
main() { int i =0;j=0; if(i && j++) printf("%d..%d",i++,j); printf("%d..%d,i,j); }
create a login program that ask username and password. if you input username or password 3 times wrong, the program will terminate else the program will prompt a message "congratulations"
Write a routine that prints out a 2-D array in spiral order
write a origram swaoing valu without 3rd variable
main() { int x=5; clrscr(); for(;x<= 0;x--) { printf("x=%d ", x--); } } a. 5, 3, 1 b. 5, 2, 1, c. 5, 3, 1, -1, 3 d. –3, -1, 1, 3, 5
void pascal f(int i,int j,int k) { printf(“%d %d %d”,i, j, k); } void cdecl f(int i,int j,int k) { printf(“%d %d %d”,i, j, k); } main() { int i=10; f(i++,i++,i++); printf(" %d\n",i); i=10; f(i++,i++,i++); printf(" %d",i); }
main() { char *p; p="%d\n"; p++; p++; printf(p-2,300); }
What is the output for the program given below typedef enum errorType{warning, error, exception,}error; main() { error g1; g1=1; printf("%d",g1); }