C Programming
Study notes are awaiting editorial approval. You can still practise the reviewed questions below.
Related previous-year questions
Practise this topic- 2026 · Consider the following three ANSI-C programs, P1, P2, and P3. ```c /* P1 */ #include <stdio.h> int a=5; int main(){ int a=7; return(0); } ``` ```c
- 2026 · Consider the following C statements: ```c char *str1 = "Hello; /* Statement S1 */ char *str2 = "Hello;"; /* Statement S2 */ int *str3 = "Hello"; /* S
- 2026 · Consider the following program in C: ```c #include <stdio.h> void func(int i, int j) { if(i < j) { int i = 0; while (i < 10) { j += 2; i++; }
- 2026 · Consider the following ANSI-C program. ```c #include <stdio.h> int main(){ int *ptr, a, b, c; a=5; b=11; c=20; ptr=&a; *ptr=c; ptr=&c; a=*(&b); c
- 2025 · Consider the following C program: ```c #include <stdio.h> void stringcopy(char *, char *); int main(){ char a[30] = "@#Hello World!"; stringc
- 2025 · ```c int x=126,y=105; do { if(x>y) x=x-y; else y=y-x; } while(x!=y); printf("%d",x); ``` The output of the given C code segment is ________. (A
- 2025 · ```c #include <stdio.h> void foo(int *p, int x){ *p=x; } int main(){ int *z; int a = 20, b = 25; z = &a; foo(z,b); printf("%d",a); return 0; }
- 2025 · Consider the following C program: ```c #include <stdio.h> int main(){ int a; int arr[5] = {30,50,10}; int *ptr; ptr = &arr[0] + 1;
- 2025 · Consider the following C program: ```c #include <stdio.h> int gate (int n) { int d, t, newnum, turn; newnum = turn = 0; t=1; while (n>=t) t *= 10;
- 2024 · Consider the following C program. Assume parameters to a function are evaluated from right to left. ```c #include <stdio.h> int g(int p) { printf("%d
- 2024 · Consider the following C program: ```c #include <stdio.h> int main(){ int a = 6; int b = 0; while(a < 10) { a = a / 12 + 1; a += b; } printf("%
- 2024 · Consider the following C function definition. ```c int fX(char *a){ char *b = a; while(*b) b++; return b - a; } ``` Which of the