प्रश्न और उत्तर का अभ्यास करें
8 0 उत्तर :
0 उत्तर :
0 उत्तर :
0 उत्तर :
0 उत्तर :
0 उत्तर :
0 उत्तर :
0 उत्तर :
प्र: 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 ); } 1709 05b5cc7dde4d2b419777515e4
5b5cc7dde4d2b419777515e4- उत्तर देखेंउत्तर छिपाएं
- Workspace
- SingleChoice
उत्तर :
व्याख्या :
Add the following function prototype in main (): float f ( int, float );
प्र: 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 "); } 1402 05b5cc7dde4d2b419777515e3
5b5cc7dde4d2b419777515e3- उत्तर देखेंउत्तर छिपाएं
- Workspace
- SingleChoice
उत्तर :
व्याख्या :
In spite of defining the function f() as returning void, the program is trying to collect the value returned by f() in the variable a.
प्र: Will the following function work? f1 ( int a, int b ) { return ( f2 (20) ); } f2 ( int a ) { return ( a * a ); } 1146 05b5cc7dde4d2b419777515e2
5b5cc7dde4d2b419777515e2- उत्तर देखेंउत्तर छिपाएं
- Workspace
- SingleChoice
उत्तर :
व्याख्या :
Yes
प्र: How many times the following program would print 'Jamboree'? main() { printf ( "\nJamboree"); main (); } 2553 05b5cc7dde4d2b419777515e1
5b5cc7dde4d2b419777515e1- उत्तर देखेंउत्तर छिपाएं
- Workspace
- SingleChoice
उत्तर :
व्याख्या :
Till the stack doesn't overflow
प्र: What would be the output of the following program? # define SQR(x) (x * x) main() { int a, b = 3; a = SQR ( b + 2 ); Printf ("\n %d ", a ); } 2267 05b5cc7dde4d2b419777515e0
5b5cc7dde4d2b419777515e0- उत्तर देखेंउत्तर छिपाएं
- Workspace
- SingleChoice
उत्तर :
व्याख्या :
11 Because, on preprocessing the expression becomes a = ( 3 + 2 * 2 + 3), as Ist preference is multiply & then addition, it evalvates as(3+ 2 * 3 +2) = (3+6+2)=11.
प्र: 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); } 1639 05b5cc7dde4d2b419777515df
5b5cc7dde4d2b419777515df- उत्तर देखेंउत्तर छिपाएं
- Workspace
- SingleChoice
उत्तर :
व्याख्या :
( int t ; t = a, a = b, b = t ;); This code won't compile since declaration of t cannot occur within parentheses.
प्र: 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) ); } 1309 05b5cc7dde4d2b419777515de
5b5cc7dde4d2b419777515de- उत्तर देखेंउत्तर छिपाएं
- Workspace
- SingleChoice
उत्तर :
व्याख्या :
1004 2 2
प्र: Would the following program compile? main() { int a = 10, *j; void *k; J = k = &a; J++; k++; printf ("\n%u %u", j, k); } 871 05b5cc7dde4d2b419777515dd
5b5cc7dde4d2b419777515dd- उत्तर देखेंउत्तर छिपाएं
- Workspace
- SingleChoice
उत्तर :
व्याख्या :
An error would be reported in the statement k++ since arithmetic on void pointers is not permitted unless the void pointer is appropriately typecasted.
hn481315337latest

