Programming_Fundamentals_Test
Programming_Fundamentals_Test
a) Memory
b) Input Unit
c) CPU
d) Output Unit
Answer: c) CPU
a) Binary
b) Decimal
c) Octal
d) Roman
Answer: d) Roman
a) Hardware
b) Software
c) Embedded software
d) Network protocol
---
### Unit 02: Types of Programming Languages
a) High-level language
b) Assembly language
c) Binary code
d) Natural language
a) Source file
b) Object file
c) Executable file
d) Pseudo-code
a) Interpreter
b) Compiler
c) Assembler
d) Macro processor
Answer: c) Assembler
---
a) Algorithm
b) Flowchart
c) Program
d) Pseudo-code
Answer: a) Algorithm
a) Rectangle
b) Oval
c) Diamond
d) Parallelogram
Answer: c) Diamond
9. What is pseudo-code?
c) Machine instructions
d) A type of compiler
---
a) int
b) float
c) string
d) void
Answer: c) string
#include <stdio.h>
int main() {
int a = 5, b = 10;
printf("%d", a + b);
return 0;
a) 10
b) 15
c) 5
d) Compilation error
Answer: b) 15
a) ?:
b) ||
c) &&
d) ==
Answer: a) ?:
---
a) for
b) while
c) do-while
Answer: c) do-while
a) int* p;
b) int p*;
c) *int p;
d) int p;
Answer: a) int* p;
15. Which of the following is used to represent multiple values of the same data
type?
a) Pointer
b) Array
c) Structure
d) Union
Answer: b) Array
---
a) int
b) void
c) float
d) char
Answer: a) int
#include <stdio.h>
void fun(int n) {
if (n == 0) return;
fun(n-1);
int main() {
fun(3);
return 0;
a) 3 2 1
b) 3 2 1 0
c) 0 1 2 3
d) Compilation error
Answer: a) 3 2 1
a) fopen
b) fwrite
c) fscanf
d) fclose
Answer: b) fwrite
---
#include <stdio.h>
int factorial(int n) {
if (n == 0) return 1;
int main() {
int num;
scanf("%d", &num);
return 0;
#include <stdio.h>
#include <string.h>
str[len - i - 1] = temp;
}
int main() {
char str[100];
scanf("%s", str);
reverse(str);
return 0;
#include <stdio.h>
int main() {
FILE *file;
scanf("%s", filename);
if (file == NULL) {
return 1;
printf("File contents:\n");
while ((ch = fgetc(file)) != EOF) {
putchar(ch);
fclose(file);
return 0;