Which of the following is a middle‑level language?
a) Assembly
b) C
c) Python
d) Machine code
b) C
Which step comes first in system development?
a) Testing b) Maintenance c) Analysis d) Coding
c) Analysis
C was developed by:
a) Dennis Ritchie
b) James Gosling
c) Bjarne Stroustrup
d) Guido van Rossum
a) Dennis Ritchie
Which keyword modifies a basic type to store only non‑negative values?
a) signed
b) unsigned
c) const
d) volatile
b) unsigned
Which of the following correctly initializes a variable in C?
a) int x; x = 10;
b) int x = 10;
c) Both a and b
d) None of the above
c) Both a and b
Which of the following is used to run a C program?
a) Compiler
b) Interpreter
c) Assembler
d) Linker only
a) Compiler
Which of the following is a valid identifier name in C? a) 123abc
b) total_marks
c) int
d) sum%value
b) total_marks
Which type qualifier ensures a variable’s value may change unexpectedly ?
a) const
b) volatile
c) restrict
d) auto
b) volatile
Which of the following is NOT a valid C token?
a) Keyword
b) Identifier
c) Constant
d) Statement
d) Statement
Which of the following best explains the difference between compilers and interpreters?
a) Compiler translates whole program, interpreter translates line by line
b) Compiler translates line by line, interpreter translates whole program c
) Both translate whole program
d) Both translate line by line
a) Compiler translates whole program, interpreter translates line by line
Which of the following correctly describes separate compilation in C?
a) Compiling multiple files together into one object file
b) Compiling each source file independently into object files, then linking
c) Compiling only header files
d) Compiling without linking
b) Compiling each source file independently into object files, then linking
Which of the following best explains the difference between compilers and interpreters?
a) Compiler translates line by line, interpreter translates whole program.
b) Compiler translates whole program, interpreter translates line by line.
c) Both translate whole program.
d) Both translate line by line.
b) Compiler translates whole program, interpreter translates line by line.
What will be printed?
#include <stdio.h>
void main() {
int x;
scanf("%d", x);
printf("%d", x);
}
a) Prints entered number
b) Garbage value
c) Error
d) Crashes
d) Crashes (missing &x in scanf).
What will be printed?
#include <stdio.h>
void main() {
const int a = 10;
scanf("%d", &a);
printf("%d", a);
}
a) Prints entered number
b) Always prints 10
c) Error
d) Garbage value
c) Error Explanation: a is constant, cannot be modified via scanf.
What will be the output?
#include <stdio.h>
void main()
{
int x = 10;
printf("%d", printf("%d", x));
}
a) 10
b) 102
c) 2
d) Undefined
b) 102
Explanation: Inner printf("%d", x) prints 10 and returns 2 (characters printed). Outer printf prints 2.
printf returns the number of characters successfully printed.
Here, printf("%d", x) prints "10".