Curioustab
Aptitude
General Knowledge
Verbal Reasoning
Computer Science
Interview
Take Free Test
Aptitude
General Knowledge
Verbal Reasoning
Computer Science
Interview
Take Free Test
Declarations and Initializations Questions
Identify the construct that is not a user-defined data type in C/C++ among the following: (1) struct book { char name[10]; float price; int pages; }; (2) long int l = 2.35; (3) enum day { Sun, Mon, Tue, Wed };
C/C++ declarations: Is there any difference between the following function declarations—(1) extern int fun(); and (2) int fun();—when no function body is provided?
C/C++ fundamentals: At what stage do we 'mention' (provide) the prototype of a function—defining, declaring, prototyping, or calling?
C linkage example: In the program shown, where is variable 'a' declared and where is it defined? (extern int a; ... int a = 20;)
C math library: Which statement correctly obtains the remainder of dividing 3.14 by 2.1 in floating-point arithmetic?
C/C++ language basics: Is the statement 'extern int i;' a declaration or a definition?
C math rounding: Which function call rounds 1.66 upward to 2.0 according to standard C/C++ library rules?
C language linkage: Which types of linkages are recognized for identifiers in C—considering scope and visibility across translation units?
C/C++ declarations: Which among the following lines are declarations (not definitions) — 1) extern int x; 2) float square(float x) { /* ... / } 3) double pow(double, double);
C/C++ literals: By default, a real (floating) numeric literal such as 3.5 is treated as which type?
C identifier rules: Which special symbol is allowed within a variable name according to standard C/C++ naming conventions?
What will be the output of the program in 16 bit platform (Turbo C under DOS)? #include
int main() { extern int i; i = 20; printf("%d ", sizeof(i)); return 0; }
What is the output of the program given below? #include
int main() { enum status { pass, fail, atkt}; enum status stud1, stud2, stud3; stud1 = pass; stud2 = atkt; stud3 = fail; printf("%d, %d, %d ", stud1, stud2, stud3); return 0; }
What is the output of the program? #include
int main() { extern int a; printf("%d ", a); return 0; } int a=20;
What will be the output of the program? #include
int X=40; int main() { int X=20; printf("%d ", X); return 0; }
What is the output of the program #include
int main() { extern int fun(float); int a; a = fun(3.14); printf("%d ", a); return 0; } int fun(int aa) { return (int)++aa; }
In the following program how long will the for loop get executed? #include
int main() { int i=5; for(;scanf("%s", &i); printf("%d ", i)); return 0; }
What is the output of the program #include
int main() { int a[5] = {2, 3}; printf("%d, %d, %d ", a[2], a[3], a[4]); return 0; }
What is the output of the program in Turbo C (in DOS 16-bit OS)? #include
int main() { char *s1; char far *s2; char huge *s3; printf("%d, %d, %d ", sizeof(s1), sizeof(s2), sizeof(s3)); return 0; }
What is the output of the program #include
int main() { int x = 10, y = 20, z = 5, i; i = x < y < z; printf("%d ", i); return 0; }
1
2