topic/Const
Start Test
Question No
Title
Type
Marks
577.
What will be the output of the program?#include<stdio.h> int main() { int y=128; const int x=y; printf("%d\n", x); return 0; }
MCQ
5
578.
What will be the output of the program?#include<stdio.h> #include<stdlib.h> union employee { char name[15]; int age; float salary; }; const union employee e1; int main() { strcpy(e1.name, "K"); printf("%s %d %f", e1.name, e1.age, e1.salary); return 0; }
MCQ
5
579.
What will be the output of the program?#include<stdio.h> int fun(int **ptr); int main() { int i=10; const int *ptr = &i; fun(&ptr); return 0; } int fun(int **ptr) { int j = 223; int *temp = &j; printf("Before changing ptr = %5x\n", *ptr); const *ptr = temp; printf("After changing ptr = %5x\n", *ptr); return 0; }
MCQ
5
580.
What will be the output of the program?#include<stdio.h> int main() { const int x=5; const int *ptrx; ptrx = &x; *ptrx = 10; printf("%d\n", x); return 0; }
MCQ
5
581.
What will be the output of the program in TurboC?#include<stdio.h> int fun(int **ptr); int main() { int i=10, j=20; const int *ptr = &i; printf(" i = %5X", ptr); printf(" ptr = %d", *ptr); ptr = &j; printf(" j = %5X", ptr); printf(" ptr = %d", *ptr); return 0; }
MCQ
5