Interview Questions

Prepare Yourself for Exams and Interview

“Master the art of programming with our C Programming practice sets. Whether you’re a novice looking to learn the basics or an experienced programmer aiming to sharpen your C skills, our practice sets provide the perfect platform. Explore a wide range of C Programming challenges and exercises designed to enhance your coding proficiency. With our comprehensive resources, you can build a strong foundation in C programming, tackle complex algorithms, and prepare yourself for coding interviews and real-world software development. Elevate your programming prowess and unlock a world of opportunities with our C Programming practice sets.”

C-PROGRAMMING PRACTICE SET-1

21



C- Programming Practice Set 1

Test Your C Programming Knowledge



1 / 25

What is the output of the following code snippet?

int a = 5, b = 7;

int c = (a > b) ? (a + b) : (b – a);

printf(“%d”, c);



2 / 25

Which of the following is not a valid way to represent an integer constant in C?



3 / 25

What does the continue statement do in a loop?



4 / 25

The malloc() function is used for:



5 / 25

What will be the output of the following code snippet?

int i;

for (i = 0; i < 3; i++) {

printf(“%d “, i);

}



6 / 25

The  fprintf() function is used to:



7 / 25

What is the output of the following code snippet?

int arr[5] = {1, 2, 3, 4, 5};

printf(“%d”, arr[5]);



8 / 25

The NULL  macro in C is used to represent:



9 / 25

What is the value of the variable X  after the following code snippet is executed?

int x = 10;

x += 5;

x *= 2;

x /= 3;



10 / 25

The C standard library function strcpy() is used to:



11 / 25

What is the return type of the strlen() function?



12 / 25

What will be the output of the following code snippet?

int i = 0;

do { printf(“%d “, i);

i++;

} while (i < 5);



13 / 25

In C, the scope of a variable declared inside a function is limited to:



14 / 25

The statement sizeof(int) returns the size of an integer in:



15 / 25

What is the correct way to initialize an array in C?



16 / 25

Which header file should be included to work with strings in C?



17 / 25

int x = 10, y = 20;

int z = (x > y) ? x : y;

printf(“%d”, z);



18 / 25

What is the purpose of the break statement in a switch statement?



19 / 25

In C, the expression  (5>2) ? 1:0 evaluates to:



20 / 25

What does the fgets() function do?



21 / 25

What is the size of the “int” data type in bytes on a 64-bit machine?



22 / 25

Which C keyword is used to define an alias for a data type?



23 / 25

What will be the output of the following code snippet?

int x = 5;
printf(“%d”, x++);



24 / 25

Which of the following is the correct way to declare an integer variable in C?



25 / 25

What is the extension of C source files?



Your score is

0%






C-PROGRAMMING PRACTICE SET-2

2

C-Programming Set -2

Test your C-Programming Knowledge

1 / 25

What will be the output of the following code snippet?

int x = 5;
int y = x | 3;
printf(“%d”, y);

2 / 25

Which header file should be included to work with time and date functions in C?

3 / 25

What will be the output of the following code snippet?

int x = 5;
int y = 10;
printf(“%d”, x < 5 ? x++ : y--);

4 / 25

Which of the following is a bitwise operator in C?

5 / 25

What is the return type of the toupper() function in C?

6 / 25

The fwrite() function is used to:

7 / 25

What will be the output of the following code snippet?

int x = 10;
printf(“%d”, x % 3);

8 / 25

Which of the following is a valid way to declare a function pointer in C?

9 / 25

What is the output of the following code snippet?

int x = 5;
printf(“%f”, x / 2);

10 / 25

What is the output of the following code snippet?

int x = 5, y = 10;
printf(“%d”, x > y ? x : y);

11 / 25

What is the output of the following code snippet?

int a = 5;
int b = a > 4 ? a++ : ++a;
printf(“%d”, b);

12 / 25

What will be the output of the following code snippet?

int x = 5;
printf(“%d”, x++ + ++x);

13 / 25

What is the output of the following code snippet?

char str1[] = “Hello”;
char str2[] = “Hello”;
if (str1 == str2)
printf(“Same”);
else
printf(“Different”);

14 / 25

What is the purpose of the exit() function in C?

15 / 25

What is the purpose of the “strcat()” function in C?

16 / 25

Which header file should be included to work with character handling functions in C?

17 / 25

What is the purpose of the “strupr()” function in C?

18 / 25

In C, what is the purpose of the “volatile” keyword?

19 / 25

In C, what is the purpose of the restrict keyword?

20 / 25

What does the static keyword do when used with a global variable in C?

21 / 25

What is the output of the following code snippet?

char str[] = “Hello”;
str[1] = ‘a’;
printf(“%s”, str);

22 / 25

What does the feof() function in C check for?

23 / 25

What is the purpose of the strncpy() function in C?

24 / 25

Which header file should be included to work with mathematical functions in C?

25 / 25

What is the value of the expression sizeof('A') in C?

Enter Your Details to get  Quiz Certificate on Email.

Your score is

0%

C-PROGRAMMING PRACTICE SET-3

4

C-PROGRAMMING SET 3

TEST YOUR C-PROGRAMMING KNOWLEDGE

1 / 25

In C, can a function call itself?

2 / 25

Which statement is used to terminate a loop in a function?

3 / 25

What is the output of the following code?

void greet() {
printf(“Hello, world!”);
}

int main() {
greet();
return 0;
}

4 / 25

What is the purpose of the return statement in a function?

5 / 25

Which part of a function is executed when the function is called?

6 / 25

Which of the following is true about a function’s return statement?

7 / 25

How do you declare a function without argument and without return type?

8 / 25

What is the main purpose of a function without argument and without return type?

9 / 25

What is the role of a function prototype for a function with argument and without return type?

10 / 25

What is the primary purpose of a function with argument and without return type?

11 / 25

What does the void keyword mean in a function declaration?

12 / 25

What is the primary characteristic of a function without argument and return type?

13 / 25

Which keyword is used to define the data type of the value returned by a function?

14 / 25

What is the purpose of a function with argument and return type?

15 / 25

What is the purpose of the sizeof operator in C?

16 / 25

Which operator is used to access the value at the address stored in a pointer variable?

17 / 25

What is the output of the following code?

int x = 10;
if (x > 5) {
printf(“Hello”);
} else {
printf(“World”);
}

 

18 / 25

In which type of loop is the loop body guaranteed to execute at least once?

19 / 25

How would you find the sum of all even numbers from 1 to 100 using a loop?

20 / 25

Which loop would you use to iterate through the elements of an array?

21 / 25

Which of the following is true about recursive functions in C?

22 / 25

What is the purpose of the void keyword in a function declaration?

23 / 25

How are function arguments passed to the called function in C?

24 / 25

Which keyword is used to return a value from a function in C?

25 / 25

What is a function prototype in C?

Enter Your Details to get  Quiz Certificate on Email.

Your score is

0%

Best Computer Training Institute In Dehradun
computer course in dehradun
computer course in dehradun

Join Thousand Of Happy Students!

Subscribe our newsletter & get latest news and updation!