Skip to main content

C Miscellaneous — Part 2 MCQs with Explanations

Practice high-yield Programming & Software Development MCQs on C Miscellaneous — Part 2 with worked academic solutions for FPSC, PPSC, NTS, NITB, PTS.

Questions
40
Difficulty Level
Exam-Level
Target Exams
FPSC, PPSC, NTS...
Estimated Time
48 mins
Exam-Level FPSC PPSC NTS NITB PTS
Verified for Commission Syllabus • Oct 14, 2026
40

Verified Practice Questions

Interactive test mode with detailed academic worked solutions

Live Progress | 0/40 answered
✓ 0 correct ✗ 0 wrong 0% score
Question 1 of 40
★ FPSC ★ PPSC

Determine Output: #include<stdio.h> void main() { char s[]={'a','b','c','n','c','\0'}; char *p, *str, *str1; p=&s[3]; str=p; str1=s; printf("%c", ++*p + ++*str1-32); }

Question 2 of 40
★ FPSC ★ PPSC

Determine Output: void main() { static char *s[] = {"black", "white", "yellow", "violet"}; char **ptr[] = {s+3, s+2, s+1, s}, ***p; p = ptr; ++p; printf("%s",*--*++p + 3); }

Question 3 of 40
★ 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; }

Question 4 of 40
★ FPSC ★ PPSC

In the absence of a exit condition in a recursive function, the following error is given . . . . . . . .

Question 5 of 40
★ FPSC ★ PPSC

What is the output of this C code? #include <stdio.h> main() { if (sizeof(int) > -1) printf("True"); else printf("False"); }

Question 6 of 40
★ FPSC ★ PPSC

What will be the value of the following assignment expression? (x = foo())!= 1 considering foo() returns 2

Question 7 of 40
★ 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:

Question 8 of 40
★ 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?

Question 9 of 40
★ FPSC ★ PPSC

File formats which have . . . . . . . . as a basic unit are independent of endianness.

Question 10 of 40
★ 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); }

Question 11 of 40
★ FPSC ★ PPSC

Sign qualifiers can be applied to double.

Question 12 of 40
★ 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); }

Question 13 of 40
★ 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; }

Question 14 of 40
★ 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); }

Question 15 of 40
★ FPSC ★ PPSC

What is the binary representation of the integer -14?

Question 16 of 40
★ FPSC ★ PPSC

Functions in C Language are always . . . . . . . .

Question 17 of 40
★ FPSC ★ PPSC

What will be the error in the following C code? main() { long float a=-25.373e22; printf("%lf",a); }

Question 18 of 40
★ 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; }

Question 19 of 40
★ FPSC ★ PPSC

A machine in which the least significant byte is stored in the smallest address is . . . . . . . .

Question 20 of 40
★ 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); }

Question 21 of 40
★ 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); }

Question 22 of 40
★ 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; }

Question 23 of 40
★ 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; }

Question 24 of 40
★ FPSC ★ PPSC

Which of the following declaration is not supported by C language?

Question 25 of 40
★ 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)); }

Question 26 of 40
★ FPSC ★ PPSC

Iteration requires more system memory than recursion.

Question 27 of 40
★ FPSC ★ PPSC

What will be the output of the following C code? #include<stdio.h> int main() { printf("Hello"); main(); return 0; }

Question 28 of 40
★ FPSC ★ PPSC

Comment on the following C statement. n = 1; printf("%d, %dn", 3*n, n++);

Question 29 of 40
★ 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; }

Question 30 of 40
★ 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; }

Question 31 of 40
★ FPSC ★ PPSC

The principle of stack is . . . . . . . .

Question 32 of 40
★ 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?

Question 33 of 40
★ 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--); } }

Question 34 of 40
★ FPSC ★ PPSC

In a signed integer, the sign is represented by . . . . . . . .

Question 35 of 40
★ FPSC ★ PPSC

What is the default state of an integer in c language?

Question 36 of 40
★ 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); }

Question 37 of 40
★ 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; }

Question 38 of 40
★ 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)); }

Question 39 of 40
★ FPSC ★ PPSC

Which of the following is not possible statically in C language?

Question 40 of 40
★ FPSC ★ PPSC

Name the function whose definition can be substituted at a place where its function call is made . . . . . . . .

✓ Link copied to clipboard
Continue Your Practice

Advance Html — Part 1

Master the next curriculum module with 40 exam-standard MCQs.

Next Practice Set →

💡 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.

More Modules in Programming & Software Development

View All →
📚

Study Guides

Topic summaries and syllabus breakdown

Explore Guides →
🎯

Complete Library

Search through 78,000+ verified MCQs

Browse Library →
📱

Mobile App

Offline mock tests and instant bookmarks

Get Mobile App →