Welcome to Your Quiz: Aptitude Test C Programming for Students

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

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 29 times, 1 visits today)
Show Buttons
Hide Buttons