p is pointing to character '\n'. str1 is pointing to character 'a'. ++*p: "p is pointing to '\n' and that is incremented by one." the ASCII value of '\n' is 10. then it is incremented to 11. the value of ++*p is 11. ++*str1: "str1 is pointing to 'a' that is incremented by 1 and it becomes 'b'. ASCII value of 'b' is 98. Both 11 and 98 is added and result is subtracted from 32. i.e. (11+98-32) = 77("M").
In this problem we have an array of char pointers "s" pointing to start of 4 strings. Then we have ptr which is a pointer to a pointer of type char and a variable p which is a pointer to a pointer to a pointer of type char. p holds the initial value of ptr, i.e. p = s+3. The next statement increment value in p by 1 , thus now value of p = s+2. In the printf statement the expression is evaluated as follows: *++p causes gets value s+1 then the pre decrement is executed and we get s+1-1 = s which is pointing to the word "black". The indirection operator now gets the value from the array of s and adds 3 to the starting address. The string is printed starting from this position. Thus, the output is 'ck'.
💡Key Conceptual Anchor:C Miscellaneous
Question 3 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What will be the output of the following C code? #include<stdio.h> main() { int n; n=f1(4); printf("%d",n); } f1(int x) { int b; if(x==1) return 1; else b=x*f1(x-1); return b; }
Correct Answer: Option A — 24
Detailed Academic Explanation:
24 is the correct answer to “What will be the output of the following C code? #include<stdio.h> main() { int n; n=f1(4); printf("%d",n); } f1(int x) { int b; if(x==1) return 1; else b=x*f1(x-1); return b; }”. This question is standard in competitive examination syllabi for C Miscellaneous.
💡Key Conceptual Anchor:C Miscellaneous
Question 4 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
In the absence of a exit condition in a recursive function, the following error is given . . . . . . . .
Correct Answer: Option B — Run time error
Detailed Academic Explanation:
Run time error is the correct answer to “In the absence of a exit condition in a recursive function, the following error is given . . . . . . . .”. This question is standard in competitive examination syllabi for C Miscellaneous.
💡Key Conceptual Anchor:C Miscellaneous
Question 5 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What is the output of this C code? #include <stdio.h> main() { if (sizeof(int) > -1) printf("True"); else printf("False"); }
Correct Answer: Option B — False
Detailed Academic Explanation:
False is the correct answer to “What is the output of this C code? #include <stdio.h> main() { if (sizeof(int) > -1) printf("True"); else printf("False"); }”. This question is standard in competitive examination syllabi for C Miscellaneous.
💡Key Conceptual Anchor:C Miscellaneous
Question 6 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What will be the value of the following assignment expression? (x = foo())!= 1 considering foo() returns 2
Correct Answer: Option A — 2
Detailed Academic Explanation:
2 is the correct answer to “What will be the value of the following assignment expression? (x = foo())!= 1 considering foo() returns 2”. This question is standard in competitive examination syllabi for C Miscellaneous.
💡Key Conceptual Anchor:C Miscellaneous
Question 7 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Suppose we have: int a=100; (signed by default). If we want to convert this to an unsigned long integer, we can do this by making the following small change:
Correct Answer: Option B — int a= 100ul
Detailed Academic Explanation:
int a= 100ul is the correct answer to “Suppose we have: int a=100; (signed by default). If we want to convert this to an unsigned long integer, we can do this by making the following small change:”. This question is standard in competitive examination syllabi for C Miscellaneous.
💡Key Conceptual Anchor:C Miscellaneous
Question 8 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Suppose we transfer a file written on a little endian machine to a big endian machine and there is no transformation from little endian to big endian, then what happens?
Correct Answer: Option B — The big endian machine reads the file in the reverse order
Detailed Academic Explanation:
The big endian machine reads the file in the reverse order is the correct answer to “Suppose we transfer a file written on a little endian machine to a big endian machine and there is no transformation from little endian to big endian, then what happens”. This question is standard in competitive examination syllabi for C Miscellaneous.
💡Key Conceptual Anchor:C Miscellaneous
Question 9 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
File formats which have . . . . . . . . as a basic unit are independent of endianness.
Correct Answer: Option A — 1 byte
Detailed Academic Explanation:
1 byte is the correct answer to “File formats which have . . . . . . . . as a basic unit are independent of endianness.”. This question is standard in competitive examination syllabi for C Miscellaneous.
💡Key Conceptual Anchor:C Miscellaneous
Question 10 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What will be the output of the following C code? #include<stdio.h> static inline int max(int a, int b) { return a > b ? a : b; } main() { int m; m=max(-6,-5); printf("%d",m); }
Correct Answer: Option B — -5
Detailed Academic Explanation:
-5 is the correct answer to “What will be the output of the following C code? #include<stdio.h> static inline int max(int a, int b) { return a > b ? a : b; } main() { int m; m=max(-6,-5); printf("%d",m); }”. This question is standard in competitive examination syllabi for C Miscellaneous.
💡Key Conceptual Anchor:C Miscellaneous
Question 11 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Sign qualifiers can be applied to double.
Correct Answer: Option B — False
Detailed Academic Explanation:
False is the correct answer to “Sign qualifiers can be applied to double.”. This question is standard in competitive examination syllabi for C Miscellaneous.
💡Key Conceptual Anchor:C Miscellaneous
Question 12 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What is the output of this C code? #include <stdio.h> main() { char *p = "Examveda C-Test"; p[0] = 'a'; p[1] = 'b'; printf("%s", p); }
Correct Answer: Option D — Run time error
Detailed Academic Explanation:
Run time error is the correct answer to “What is the output of this C code? #include <stdio.h> main() { char *p = "Examveda C-Test"; p[0] = 'a'; p[1] = 'b'; printf("%s", p); }”. This question is standard in competitive examination syllabi for C Miscellaneous.
💡Key Conceptual Anchor:C Miscellaneous
Question 13 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
The following C code results in an error. State whether this statement is true or false. #include <stdio.h> void f(double b) { printf ("%ld\n",b); } int main() { inline f(100.56); return 0; }
Correct Answer: Option A — True
Detailed Academic Explanation:
True is the correct answer to “The following C code results in an error. State whether this statement is true or false. #include <stdio.h> void f(double b) { printf ("%ld\n",b); } int main() { inline f(100.56); return 0; }”. This question is standard in competitive examination syllabi for C Miscellaneous.
💡Key Conceptual Anchor:C Miscellaneous
Question 14 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What will be the output of the following C code? main() { unsigned a=10; long unsigned b=5l; printf(“%lu%u”,a,b); }
Correct Answer: Option A — 105
Detailed Academic Explanation:
105 is the correct answer to “What will be the output of the following C code? main() { unsigned a=10; long unsigned b=5l; printf(“%lu%u”,a,b); }”. This question is standard in competitive examination syllabi for C Miscellaneous.
💡Key Conceptual Anchor:C Miscellaneous
Question 15 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What is the binary representation of the integer -14?
Correct Answer: Option A — 11110
Detailed Academic Explanation:
11110 is the correct answer to “What is the binary representation of the integer -14”. This question is standard in competitive examination syllabi for C Miscellaneous.
💡Key Conceptual Anchor:C Miscellaneous
Question 16 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Functions in C Language are always . . . . . . . .
Correct Answer: Option B — External
Detailed Academic Explanation:
External is the correct answer to “Functions in C Language are always . . . . . . . .”. This question is standard in competitive examination syllabi for C Miscellaneous.
💡Key Conceptual Anchor:C Miscellaneous
Question 17 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What will be the error in the following C code? main() { long float a=-25.373e22; printf("%lf",a); }
Correct Answer: Option B — Long and float cannot be used together
Detailed Academic Explanation:
Long and float cannot be used together is the correct answer to “What will be the error in the following C code? main() { long float a=-25.373e22; printf("%lf",a); }”. This question is standard in competitive examination syllabi for C Miscellaneous.
💡Key Conceptual Anchor:C Miscellaneous
Question 18 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What will be the output of the following C code if the input given to the code shown below is "examveda"? #include<stdio.h> #define NL '\n' void main() { void f(void); printf("enter the word\n"); f(); } void f(void) { char c; if((c=getchar())!=NL) { f(); printf("%c",c); } return; }
Correct Answer: Option C — adevmaxe
Detailed Academic Explanation:
adevmaxe is the correct answer to “What will be the output of the following C code if the input given to the code shown below is "examveda"? #include<stdio.h> #define NL '\n' void main() { void f(void); printf("enter the word\n"); f(); } void f(void) { char c; if((c=getchar())!=NL) { f(); printf("%c",c); } return; }”. This question is standard in competitive examination syllabi for C Miscellaneous.
💡Key Conceptual Anchor:C Miscellaneous
Question 19 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
A machine in which the least significant byte is stored in the smallest address is . . . . . . . .
Correct Answer: Option D — Little endian machine
Detailed Academic Explanation:
Little endian machine is the correct answer to “A machine in which the least significant byte is stored in the smallest address is . . . . . . . .”. This question is standard in competitive examination syllabi for C Miscellaneous.
💡Key Conceptual Anchor:C Miscellaneous
Question 20 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What is the difference between the following 2 C codes? #include <stdio.h> //Program 1 int main() { int d, a = 1, b = 2; d = a++ + ++b; printf("%d %d %d", d, a, b); } #include <stdio.h> //Program 2 int main() { int d, a = 1, b = 2; d = a++ +++b; printf("%d %d %d", d, a, b); }
Correct Answer: Option D — Program 2 has syntax error, program 1 is not
Detailed Academic Explanation:
Program 2 has syntax error, program 1 is not is the correct answer to “What is the difference between the following 2 C codes? #include <stdio.h> //Program 1 int main() { int d, a = 1, b = 2; d = a++ + ++b; printf("%d %d %d", d, a, b); } #include <stdio.h> //Program 2 int main() { int d, a = 1, b = 2; d = a++ +++b; printf("%d %d %d", d, a, b); }”. This question is standard in competitive examination syllabi for C Miscellaneous.
💡Key Conceptual Anchor:C Miscellaneous
Question 21 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What will be the output of the following C code? #include<stdio.h> extern inline int min(int a, int b) { return a < b ? a : b; } main() { int m; m=min(3,-5); printf("%d",m); }
Correct Answer: Option A — Error
Detailed Academic Explanation:
Error is the correct answer to “What will be the output of the following C code? #include<stdio.h> extern inline int min(int a, int b) { return a < b ? a : b; } main() { int m; m=min(3,-5); printf("%d",m); }”. This question is standard in competitive examination syllabi for C Miscellaneous.
💡Key Conceptual Anchor:C Miscellaneous
Question 22 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What will be the output of the following C code? #include<stdio.h> int main() { signed char ch= ‘a’; printf(“%u”,ch); return 0; }
Correct Answer: Option D — 97
Detailed Academic Explanation:
97 is the correct answer to “What will be the output of the following C code? #include<stdio.h> int main() { signed char ch= ‘a’; printf(“%u”,ch); return 0; }”. This question is standard in competitive examination syllabi for C Miscellaneous.
💡Key Conceptual Anchor:C Miscellaneous
Question 23 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What will be the output of the following C code? #include <stdio.h> void inline func1(char b[10]) { printf ("%c\n",b[2]); } int main() { func1("examveda"); return 0; }
Correct Answer: Option B — a
Detailed Academic Explanation:
a is the correct answer to “What will be the output of the following C code? #include <stdio.h> void inline func1(char b[10]) { printf ("%c\n",b[2]); } int main() { func1("examveda"); return 0; }”. This question is standard in competitive examination syllabi for C Miscellaneous.
💡Key Conceptual Anchor:C Miscellaneous
Question 24 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which of the following declaration is not supported by C language?
Correct Answer: Option A — String str
Detailed Academic Explanation:
String str is the correct answer to “Which of the following declaration is not supported by C language”. This question is standard in competitive examination syllabi for C Miscellaneous.
💡Key Conceptual Anchor:C Miscellaneous
Question 25 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What will be the output of the following C code? #include<stdio.h> int main() { int n=10; int f(int n); printf("%d",f(n)); } int f(int n) { if(n>0) return(n+f(n-2)); }
Correct Answer: Option C — 30
Detailed Academic Explanation:
30 is the correct answer to “What will be the output of the following C code? #include<stdio.h> int main() { int n=10; int f(int n); printf("%d",f(n)); } int f(int n) { if(n>0) return(n+f(n-2)); }”. This question is standard in competitive examination syllabi for C Miscellaneous.
💡Key Conceptual Anchor:C Miscellaneous
Question 26 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Iteration requires more system memory than recursion.
Correct Answer: Option B — False
Detailed Academic Explanation:
False is the correct answer to “Iteration requires more system memory than recursion.”. This question is standard in competitive examination syllabi for C Miscellaneous.
💡Key Conceptual Anchor:C Miscellaneous
Question 27 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What will be the output of the following C code? #include<stdio.h> int main() { printf("Hello"); main(); return 0; }
Correct Answer: Option B — Hello infinite number of times
Detailed Academic Explanation:
Hello infinite number of times is the correct answer to “What will be the output of the following C code? #include<stdio.h> int main() { printf("Hello"); main(); return 0; }”. This question is standard in competitive examination syllabi for C Miscellaneous.
💡Key Conceptual Anchor:C Miscellaneous
Question 28 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Comment on the following C statement. n = 1; printf("%d, %dn", 3*n, n++);
Correct Answer: Option D — Output is compiler dependent
Detailed Academic Explanation:
Output is compiler dependent is the correct answer to “Comment on the following C statement. n = 1; printf("%d, %dn", 3*n, n++);”. This question is standard in competitive examination syllabi for C Miscellaneous.
💡Key Conceptual Anchor:C Miscellaneous
Question 29 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What will be the output of the following C code? #include<stdio.h> main() { signed char a[]= “BAT”; printf(“%c”, a[1]); return 0; }
Correct Answer: Option C — A
Detailed Academic Explanation:
A is the correct answer to “What will be the output of the following C code? #include<stdio.h> main() { signed char a[]= “BAT”; printf(“%c”, a[1]); return 0; }”. This question is standard in competitive examination syllabi for C Miscellaneous.
💡Key Conceptual Anchor:C Miscellaneous
Question 30 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What will be the output of the following C code? #include <stdio.h> void inline func1(int a, int b) { printf ("a=%d and b=%d\n", a, b); } int inline func2(int x) { return x*x; } int main() { int tmp; func1(1,4); tmp = func2(6); printf("square val=%d\n", tmp); return 0; }
Correct Answer: Option A — a=1 and b=4 square val = 36
Detailed Academic Explanation:
a=1 and b=4 square val = 36 is the correct answer to “What will be the output of the following C code? #include <stdio.h> void inline func1(int a, int b) { printf ("a=%d and b=%d\n", a, b); } int inline func2(int x) { return x*x; } int main() { int tmp; func1(1,4); tmp = func2(6); printf("square val=%d\n", tmp); return 0; }”. This question is standard in competitive examination syllabi for C Miscellaneous.
💡Key Conceptual Anchor:C Miscellaneous
Question 31 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
The principle of stack is . . . . . . . .
Correct Answer: Option C — Last in first out
Detailed Academic Explanation:
Last in first out is the correct answer to “The principle of stack is . . . . . . . .”. This question is standard in competitive examination syllabi for C Miscellaneous.
💡Key Conceptual Anchor:C Miscellaneous
Question 32 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which of the following header files must necessarily be included in your code, if you want to find the minimum value of unsigned short integer?
Correct Answer: Option C — limits.h
Detailed Academic Explanation:
limits.h is the correct answer to “Which of the following header files must necessarily be included in your code, if you want to find the minimum value of unsigned short integer”. This question is standard in competitive examination syllabi for C Miscellaneous.
💡Key Conceptual Anchor:C Miscellaneous
Question 33 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
How many times is 'a' printed when the following C code is executed? #include<stdio.h> main() { int a; a=f1(10); printf("%d",a); } f1(int b) { if(b==0) return 0; else { printf("a"); f1(b--); } }
Correct Answer: Option D — Infinite number of times
Detailed Academic Explanation:
Infinite number of times is the correct answer to “How many times is 'a' printed when the following C code is executed? #include<stdio.h> main() { int a; a=f1(10); printf("%d",a); } f1(int b) { if(b==0) return 0; else { printf("a"); f1(b--); } }”. This question is standard in competitive examination syllabi for C Miscellaneous.
💡Key Conceptual Anchor:C Miscellaneous
Question 34 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
In a signed integer, the sign is represented by . . . . . . . .
Correct Answer: Option B — Most significant bit
Detailed Academic Explanation:
Most significant bit is the correct answer to “In a signed integer, the sign is represented by . . . . . . . .”. This question is standard in competitive examination syllabi for C Miscellaneous.
💡Key Conceptual Anchor:C Miscellaneous
Question 35 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What is the default state of an integer in c language?
Correct Answer: Option A — Signed
Detailed Academic Explanation:
Signed is the correct answer to “What is the default state of an integer in c language”. This question is standard in competitive examination syllabi for C Miscellaneous.
💡Key Conceptual Anchor:C Miscellaneous
Question 36 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Comment on the output of following C code. #include <stdio.h> main() { char *p = 0; *p = 'a'; printf("value in pointer p is %c\n", *p); }
Correct Answer: Option D — Run time error
Detailed Academic Explanation:
Run time error is the correct answer to “Comment on the output of following C code. #include <stdio.h> main() { char *p = 0; *p = 'a'; printf("value in pointer p is %c\n", *p); }”. This question is standard in competitive examination syllabi for C Miscellaneous.
💡Key Conceptual Anchor:C Miscellaneous
Question 37 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What will be the output of the following C code? #include <stdio.h> void inline f1(char b) { printf ("%d\n",b); } int main() { f1('a'); return 0; }
Correct Answer: Option D — 97
Detailed Academic Explanation:
97 is the correct answer to “What will be the output of the following C code? #include <stdio.h> void inline f1(char b) { printf ("%d\n",b); } int main() { f1('a'); return 0; }”. This question is standard in competitive examination syllabi for C Miscellaneous.
💡Key Conceptual Anchor:C Miscellaneous
Question 38 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
If the code shown below is executed on a little endian machine, then what will be the output of the following C code? #include<stdio.h> main() { int y=1; printf("%d", (*(char*)&y)); }
Correct Answer: Option A — 1
Detailed Academic Explanation:
1 is the correct answer to “If the code shown below is executed on a little endian machine, then what will be the output of the following C code? #include<stdio.h> main() { int y=1; printf("%d", (*(char*)&y)); }”. This question is standard in competitive examination syllabi for C Miscellaneous.
💡Key Conceptual Anchor:C Miscellaneous
Question 39 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which of the following is not possible statically in C language?
Correct Answer: Option A — Jagged Array
Detailed Academic Explanation:
Jagged Array is the correct answer to “Which of the following is not possible statically in C language”. This question is standard in competitive examination syllabi for C Miscellaneous.
💡Key Conceptual Anchor:C Miscellaneous
Question 40 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Name the function whose definition can be substituted at a place where its function call is made . . . . . . . .
Correct Answer: Option B — inline function
Detailed Academic Explanation:
inline function is the correct answer to “Name the function whose definition can be substituted at a place where its function call is made . . . . . . . .”. This question is standard in competitive examination syllabi for C Miscellaneous.
💡Key Conceptual Anchor:C Miscellaneous
✓Link copied to clipboard
Continue Your Practice
Advance Html — Part 1
Master the next curriculum module with 40 exam-standard MCQs.
💡Examiner's Advisory for Programming & Software Development
In competitive commission exams (FPSC, PPSC, KPPSC, SPSC, CSS, PMS), questions are frequently phrased with distractor options designed to catch rote learners. Whenever you answer an MCQ, read the Detailed Academic Explanation and Conceptual Anchor to understand why the remaining options are incorrect.