Note: Green indicates correct answer and Red indicates Wrong answer
1. What is the output of the below c code?
#include<stdio.h> main() { char c = 'A'+255; printf("%c", c); }
2. What is the output of the below c code?
#include<stdio.h> main() { int i = 1; while( i++<=5 ) printf("%d ",i++); }
3. Which is the best description of concatenation?
#include<stdio.h> main() { union abc { int x; char ch; } var; var.ch = 'A'; printf("%d", var.x); }
4. What is the output of the below c code?
#include<stdio.h> main() { char s1[50], s2[50] = "Hello"; s1 = s2; printf("%s", s1); }
5. Which header statement is missing in the given below program to get the desired output?
#include<stdio.h> int main () { double x = 1234321; double result = sqrt(x); printf("The square root of %.2lf is %.2lf\n", x, result); return 0; }
6. For the below definition what is the data type of ‘PI’
#define PI 3.141
7. Which of the following operator can be used to access value at address stored in a pointer variable?
8. In DOS, how many bytes exist for near, far and huge pointers?
9. What do the following statement defines?
int *ptr[10];
10. If, the given below code finds the length of the string then what will be the length?
#include<stdio.h> int xstrlen(char *s) { int length = 0; while(*s!='\0') {length++; s++;} return (length); } int main() { char d[] = "IndiaMAX"; printf("Length = %d\n", xstrlen(d)); return 0; }
Tags:
C Quiz