A - B. C. D .: Int Fun Is Overrided With Extern Int Fun
A - B. C. D .: Int Fun Is Overrided With Extern Int Fun
A - B. C. D .: Int Fun Is Overrided With Extern Int Fun
TIME: 20 MINUTES
B.double
C.long double
D
far double
.
3
. Is the following statement a declaration or definition?
extern int i;
A
Declaration
.
B.Definition
C.Function
D
Error
.
4.
B.use 3.14L
C.use 3.14DL
D
use 3.14LF
.
5
. We want to round off x, a float, to an int value, The correct way to do is
A y = (int)(x + 0.5)
ROLL NO:
.
C.y = (int)x + 0.5
D
y = (int)((int)x + 0.5)
.
A
C
.
C.Compiler error
7.
B.C++
D.Non of above
#include<stdio.h>
#include<math.h>
int main()
{
printf("%f\n", sqrt(36.0));
return 0;
}
A
6.0
.
C.6.000000
B.6
D.Error: Prototype sqrt() not found.
8. int main()
{
int x = 10, y = 20, z = 5, i;
i = x < y < z;
printf("%d\n", i);
return 0;
}
A
0
.
C.Error
B.1
D.None of these
9.
1. What is the correct value to return to the operating system upon the successful
completion of a program?
A. -1
B. 1
C. 0
D. Programs do not return a value.
10.
int main()
{
void v = 0;
printf("%d", v);
return 0;
}
A
Error: Declaration syntax error 'v' (or) Size of v is unknown or zero.
.
B.Program terminates abnormally.
C.No error.
D
None of these.
.
11.
B.| (pipeline)
D._ (underscore)
12. Which header file should be included to use functions like malloc() and calloc()?
A
memory.h
.
B.stdlib.h
C.string.h
D
dos.h
.
A
I=4 j=2
.
C. i=5 j=2
B. i=3 j=2
D. Undefined behaviour
14. #include<stdio.h>
int main()
{
int y=128;
const int x=y;
printf("%d\n", x);
return 0;
}
A
128
.
C.Error
B.Garbage value
D.0
15.
int main()
{
extern int a;
printf("%d\n", a);
return 0;
}
int a=20;
A
20
.
C.Garbage Value
B.0
D.Error
16.
int main()
{
int X=40;
{
int X=20;
printf("%d ", X);
}
printf("%d\n", X);
return 0;
}
A
extern int a is declaration, int a = 20 is the definition
.
B.int a = 20 is declaration, extern int a is the definition
C.int a = 20 is definition, a is not defined
D a is declared, a is not defined
.
17. Write the output(if any) of the given program (2 marks). If error, mention the
error & reason.
void abc()
{
auto int b=0;
Static int s;
s=0;
++s;
++b;
printf(%d %d \n , b, s);
}
void main()
{
abc(); abc(); abc();
}
18. Write a program to swap two numbers without using a temporary variable. (2
marks)