Aptitude Test C Programming for Students

Welcome to Your Quiz: Aptitude Test C Programming for Students

Name Email
1. In mathematics and computer programming, which is the correct order of mathematical operators
2. Point out the error in the following program.
#include <stdio.h>
#include <stdlib.h>
int main()
{
static char *p = (char *)malloc(10);
return 0;
}
3. Will the expression *p = p be disallowed by the compiler?
4. 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;
}
5. 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;
}
6. Which header file should be included to use functions like malloc() and calloc()?
7. Name the loop that executes at least once.
8. What do the following declaration signify ?
void (*cmp)();
9. A preprocessor directive is a message from programmer to the preprocessor.
10. Left shifting an unsigned int or char by 1 is always equivalent to multiplying it by 2.
11. Prototype of a function means _____
12. 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
13. What does the following declaration mean?
int (*ptr)[10];
14. Input/output function prototypes and macros are defined in which header file?
15. 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;
}
16. 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?
17. 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?
18. The way the break is used to take control out of switch and continue to take control of the beginning of the switch?
19. Which one is not a reserved keyword in C Language?
20. A C variable name can start with a ____

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 30 times, 1 visits today)