Curioustab
Aptitude
General Knowledge
Verbal Reasoning
Computer Science
Interview
Aptitude
General Knowledge
Verbal Reasoning
Computer Science
Interview
Programming Questions
What is the output of this C code? #include void m() { printf("hi"); } void main() { m(); }
The output of the code below is #include int *m() { int *p = 5; return p; } void main() { int *k = m(); printf("%d", k); }
What would be the output of the following program? main() { extern int i; i = 20; printf( "%d", sizeof(i) ); }
What is the difference between the following declarations? extern int fun(); int fun();
Point out the error, if any, in the following program. main() { int ( *p )() = fun; ( *P ) (); } fun () { Printf ( "\nLoud and clear" ); }
Point out the error, if any, in the while loop. main() { int i = 1; while () { printf ( "%d", i++); if (i >10) break ; } }
Point out the error, if any, in the following program. main() { int i = 4, j = 2; switch(i) { case 1 : printf (''\n To err is human, to forgive is against company policy."); break; case j : printf (''\n if you have nothing to do, don't do it here."); break; } }
What would be the output of the following program? main() { static int a[20]; int i = 0; a[i] = i++; printf ("\n%d%d%d", a[0], a[1], i); }
What would be the output of the following program? main() { int i=2 ; printf ("\n%d%d", ++i, ++i ); }
In the following code in which order the functions would be called? a = ( f1 ( 23,14 ) * f2 ( 12/4) ) + f3() ;
Which error are you likely to get when you run the following program? main() { struct emp { char name[20]; float sal; }; struct emp e[10]; int i; for ( i = 0 ; i <= 9; i++) scanf ( "%s %f" , e[i].name, &e[i].sal ); }
What would be the output of the following program? main() { printf (" %d%d%d ", sizeof (3.14f), sizeof (3.14), sizeof (3. 141); }
What would be the output of the following program? main() { float a = 0.7; if ( a < 0.7f ) printf ( " C "); else Printf ( " C++ "); }
There is a mistake in the following code. Add a statement in it to remove it. main() { int a; a = f (10, 3.14) ; printf ( " %d ", a ); } f (int aa, float bb) { return ( ( float ) aa + bb ); }
Point out the error, if any, in the following program. main() { int a = 10; void f(); a = f(); printf ( "\n %d", a ); } void f() { printf ( "\n Hi "); }
Will the following function work? f1 ( int a, int b ) { return ( f2 (20) ); } f2 ( int a ) { return ( a * a ); }
Indicate what would the SWAP macro be expanded to on preprocessing. Would the code compile? #define SWAP (a, b, c ) (c t; t = a, a = b, b = t; ) main() { int x = 10, y = 20; SWAP (x, y, int ); printf ( " %d%d ", x, y); }
What would be the output of the following program assuming that the array beigns at location 1002? main() { int a[3][4] = { 1 , 2 , 3 , 4 5, 6 , 7, 8 9, 10 , 11, 12 }; Printf ("\n%u %u %u", a[0] + 1, *( a[0] + 1), *( *(a + 0) + 1) ); }
Undefined reference to 'pthread_create' How to Fix this error?
In HTML, ___________ tag is used to construct drop-down list boxes and scrolling list boxes.
1
2
3
4
5
6