Welcome to Your Quiz: Aptitude Test C Programming for Students

Name Email
1.

Which of the following statements are correct about the program?
#include <stdio.h>
int main()
{
unsigned int num;
int i;
scanf("%u", &num);
for(i=0; i<16; i++)
{
printf("%d", (num<<i & 1<<15)?1:0);
}
return 0;
}
It prints all even bits from num

(Visited 26 times, 1 visits today)
2.

Input/output function prototypes and macros are defined in which header file?

(Visited 26 times, 1 visits today)
3.

A C variable name can start with a ____

(Visited 26 times, 1 visits today)
4.

Left shifting an unsigned int or char by 1 is always equivalent to multiplying it by 2.

(Visited 26 times, 1 visits today)
5.

Which one is not a reserved keyword in C Language?

(Visited 26 times, 1 visits today)
6.

Which header file should be included to use functions like malloc() and calloc()?

(Visited 26 times, 1 visits today)
7.

Prototype of a function means _____

(Visited 26 times, 1 visits today)
8.

What does the following declaration mean?
int (*ptr)[10];

(Visited 26 times, 1 visits today)
9.

Name the loop that executes at least once.

(Visited 26 times, 1 visits today)
10.

Will the expression *p = p be disallowed by the compiler?

(Visited 26 times, 1 visits today)
11.

Point out the error in the following program.
#include <stdio.h>
#include <stdlib.h>
int main()
{
static char *p = (char *)malloc(10);
return 0;
}

(Visited 26 times, 1 visits today)
12.

What will be the output of the program ?
#include <stdio.h>
char *str = "char *str = %c%s%c; main(){ printf(str, 34, str, 34);}";
int main()
{
printf(str, 34, str, 34);
return 0;
}

(Visited 26 times, 1 visits today)
13.

In mathematics and computer programming, which is the correct order of mathematical operators

(Visited 26 times, 1 visits today)
14.

A float occupies 4 bytes. If the hexadecimal equivalent of these 4 bytes are A, B, C and D, then when this float is stored in memory in which of the following order do these bytes gets stored?

(Visited 26 times, 1 visits today)
15.

What do the following declaration signify ?
void (*cmp)();

(Visited 26 times, 1 visits today)
16.

What will be the output of the program ?
#include<stdio.h>
int main()
{
enum status { pass, fail, atkt};
enum status stud1, stud2, stud3;
stud1 = pass;
stud2 = atkt;
stud3 = fail;
printf("%d, %d, %d\n", stud1, stud2, stud3);
return 0;
}

(Visited 26 times, 1 visits today)
17.

The way the break is used to take control out of switch and continue to take control of the beginning of the switch?

(Visited 26 times, 1 visits today)
18.

What will be the output of the program in 16-bit platform (under DOS)?
#include<stdio.h>
int main()
{
struct node
{
int data;
struct node *link;
};
struct node *p, *q;
p = (struct node *) malloc(sizeof(struct node));
q = (struct node *) malloc(sizeof(struct node));
printf("%d, %d\n", sizeof(p), sizeof(q));
return 0;
}

(Visited 26 times, 1 visits today)
19.

A preprocessor directive is a message from programmer to the preprocessor.

(Visited 26 times, 1 visits today)
20.

Which of the following statements correctly declare a function that receives a pointer to pointer to a pointer to a float and returns a pointer to a pointer to a pointer to a pointer to a float?

(Visited 26 times, 1 visits today)

Thank You for Submitting your response for Quiz

Aptitude Test C Programming for Students

Please click on View Result Button to see the Result.



(Visited 26 times, 1 visits today)
Show Buttons
Hide Buttons