C Programming :: Pointers
-
What will be the output of the program assuming that the array begins at the location 1002 and size of an integer is 4 bytes?
#includeint main() { int a[3][4] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 }; printf("%u, %u, %u\n", a[0]+1, *(a[0]+1), *(*(a+0)+1)); return 0; } -
What will be the output of the program?
#includeint main() { int arr[3] = {2, 3, 4}; char *p; p = arr; p = (char*)((int*)(p)); printf("%d, ", *p); p = (int*)(p+1); printf("%d", *p); return 0; } -
What will be the output of the program ?
#includeint main() { char *str; str = "%d\n"; str++; str++; printf(str-2, 300); return 0; } -
What will be the output of the program ?
#includeint main() { printf("%c\n", 7["FRESHERGATE"]); return 0; } -
What will be the output of the program ?
#includeint main() { char str[] = "peace"; char *s = str; printf("%s\n", s++ +3); return 0; } -
What will be the output of the program ?
int main() { char *p; p="hello"; printf("%s\n", *&*&p); return 0; } -
What will be the output of the program assuming that the array begins at location 1002?
#includeint main() { int a[2][3][4] = { {1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 1, 2}, {2, 1, 4, 7, 6, 7, 8, 9, 0, 0, 0, 0} }; printf("%u, %u, %u, %d\n", a, *a, **a, ***a); return 0; } -
What will be the output of the program ?
#include power(int**); int main() { int a=5, *aa; /* Address of 'a' is 1000 */ aa = &a; a = power(&aa); printf("%d\n", a); return 0; } power(int **ptr) { int b; b = **ptr***ptr; return (b); } -
What will be the output of the program ?
#include int main() { char str1[] = "fresher"; char str2[] = "GATE"; char *s1 = str1, *s2=str2; while(*s1++ = *s2++) printf("%s", str1); printf("\n"); return 0; } -
What will be the output of the program ?
#include #includeint main() { int i, n; char *x="Alice"; n = strlen(x); *x = x[n]; for(i=0; i"%s ", x); x++; } printf("\n", x); return 0; }

Whatsapp
Facebook