Curioustab
Aptitude
General Knowledge
Verbal Reasoning
Computer Science
Interview
Aptitude
General Knowledge
Verbal Reasoning
Computer Science
Interview
Declarations and Initializations Questions
Which of the following is not user defined data type? 1 : struct book { char name[10]; float price; int pages; }; 2 : long int l = 2.35; 3 : enum day {Sun, Mon, Tue, Wed};
Is there any difference between following declarations? 1 : extern int fun(); 2 : int fun();
When we mention the prototype of a function?
In the following program where is the variable a getting defined and where it is getting declared? #include<stdio.h> int main() { extern int a; printf("%d\n", a); return 0; } int a=20;
Which of the following statements should be used to obtain a remainder after dividing 3.14 by 2.1?
Is the following statement a declaration or definition? extern int i;
How would you round off a value from 1.66 to 2.0?
What are the types of linkages?
Identify which of the following are declarations 1 : extern int x; 2 : float square ( float x ) { ... } 3 : double pow(double, double);
By default a real number is treated as a
Which of the following special symbol allowed in a variable name?
What will be the output of the program in 16 bit platform (Turbo C under DOS)? #include<stdio.h> int main() { extern int i; i = 20; printf("%d\n", sizeof(i)); return 0; }
What is the output of the program given below? #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; }
What is the output of the program? #include<stdio.h> int main() { extern int a; printf("%d\n", a); return 0; } int a=20;
What will be the output of the program? #include<stdio.h> int X=40; int main() { int X=20; printf("%d\n", X); return 0; }
What is the output of the program #include<stdio.h> int main() { extern int fun(float); int a; a = fun(3.14); printf("%d\n", a); return 0; } int fun(int aa) { return (int)++aa; }
In the following program how long will the for loop get executed? #include<stdio.h> int main() { int i=5; for(;scanf("%s", &i); printf("%d\n", i)); return 0; }
What is the output of the program #include<stdio.h> int main() { int a[5] = {2, 3}; printf("%d, %d, %d\n", a[2], a[3], a[4]); return 0; }
What is the output of the program in Turbo C (in DOS 16-bit OS)? #include<stdio.h> int main() { char *s1; char far *s2; char huge *s3; printf("%d, %d, %d\n", sizeof(s1), sizeof(s2), sizeof(s3)); return 0; }
What is the output of the program #include<stdio.h> int main() { int x = 10, y = 20, z = 5, i; i = x < y < z; printf("%d\n", i); return 0; }
1
2