Professional Documents
Culture Documents
C Celect1
C Celect1
Data Types
l In little-endian systems addresses are always in ABCD and data is stored in DCBA
order
l In big-endian system addresses are always in ABCD and data is stored in ABCD
order
l Cycle is present in integer and character data type but not present in float or
double types
l Increments the value of a float or double variable beyond its maximum range that
is +INF and beyond it minimum range is –INF
l The minimum octal character constant is ‘\000’ and maximum octal character
constant is ‘\377’
l Very first escape sequence character is ‘\a’ and last escape sequence character is
‘\r’
l Float data always stores in memory mantissa and exponent format
l Enum data types creates a sequence sets of integral constants
l There is no cycle present in enum data type
l BCPL is a type less language
l When a language is able to produce a new data type that is called extensibility
l Tyepdef creates a new name but does not create a new type
l Addresses in memory always in ABCD format but data store in memory in ABCD
or DCBA that depends on system
l The process of byte ordering is known as endianess
l 32 bits recurring binary of a float is always lesser than 64 bits recurring binary of
a float
l When a signed negative integer compared with an unsigned integer , its binary
level of variable is compared not their value level
l Signed and unsigned modifier is not allowed in float or double data types
l All constants in C are Rvalue category of objects
l Constant variables, array name, function name, enum constants are Rvalue category
of objects
l All escape sequence characters are octal character constants
l The size of the null string constant is 1 byte
l ‘\0’ is null character constant whose ASCII value is 0
l Length of the Variable name beyond 32 characters are no use
2 Celect
46. The range of an integer constant for a computer 52. Find the output
with ‘w’ bit word is
void main()
a) -2(power of w) to +2(power of w-1) -1 {
b) -2(power of w-1) to +2(power of w+1) -1 int x=9;
c) -2(power ofw-1) to +2(power ofw-1)+1 float f=(float)x/2;
d) -2(power ofw-1) to +2(power ofw-1) -1 printf(“%d”,f);
}
47. ASCII code to represent a character set uses
how many bits? a) 4.50000
b) 4
a) 6 bits
c) 0
b) 7 bits
d) Garbage value
c) 8 bits
d) None of these 53. Find the output
48. Which of the following is/are valid white space void main()
character? {
int x=266;
I. Blank space
printf(“%0x”,x);
II. Horizontal tab
}
III. Form feed
IV. New line a) No output
b) 266
a) only I
c) 10A
b) both I & IV
d) 10a
c) I, II & IV
d) All of the above 54. Find the output
49. Find the output void main()
{
void main()
int x=0378;
{
printf(“%d”,x);
int a=5,b=3,c;
}
c=a,a=b,b=c;
printf(“%d %d”,a,b); a) 0378
} b) 378
c) Compilation error
a) 3 5
d) None of these
b) 5 3
c) Compilation error 55. Find the output
d) None of these
void main()
50. Find the output {
printf(“ab/*cd*/ef”);
#include”limits.h”
}
void main()
{ a) abef
signed short int x=9; b) ab
if((x&INT_MIN)==INT_MIN) c) ab/*cd*/ef
printf(“negative”); d) Error: comments are not allowed within the
else sentence
printf(“positive”);
} 56. Find the output.
a) positive void main()
b) negative {
c) Compilation error int a=1,b;
d) None of these b=+-+a+-a;
printf(“%d”,b);
51. L-value is not applicable to
}
a) Scaler data types
a) 0
b) Derived data types
b) 2
c) Pointer
c) -2
d) Function name
d) None of these
6 Celect
a) 2 a) 5
b) 0 b) -5
c) 3 c) 65631
d) None of these d) 32762
90. Unreliable conversion between int and float is 95. Width of address bus of Pentium IV processor
called as is
a) Data overflow a) 32 bits
b) Data underflow b) 64 bits
c) Suffering c) 128 bits
d) None of these d) None of these
91. Find the output. 96. Find the output.
void main() void main()
{ {
int x=0xA; float x=3.2;
int y=012; float y=2.2;
int z=10; printf(“%.2f”,x/y);
if(x==y==z) }
printf(“mystery”);
a) 1.45
else
b) 1.45 45 45
printf(“shocked”);
c) 1.50
}
d) Expression syntax error
a) mystery
97. Find the output.
b) shocked
c) Invalid assignment void main()
d) None of these {
int x=1;
92. Find the output
if(x++>=x)
void main() printf(“%d”,x);
{ else
int x=5,y=3; printf(“%d”,++x);
x=x+~y+1; }
printf(“%d”,x);
a) 2
}
b) 3
a) 4 c) Compilation error
b) -2 d) None of these
c) 2
98. Find the output.
d) None of these
void main()
93. Find the output.
{
void main() char x,y;
{ printf(“%d”,scanf(“%c%c”,&x,&y));
int x; }
x=printf(“lak\\rshya”);
a) 2
printf(“%d”,x);
b) Segmentation violation
}
c) A fatal error
a) lak\9 d) Compilation error
b) shya\8
99. Find the output
c) lak\rshya9
d) None of these void main()
{
94. Find the output
int a=9;
void main() char c;
{ c=2*20.5+a;
printf(“%f”,9/5); printf(“%c”,c);
} }
a) 1.0 a) a
b) 1.8 b) b
c) 2.0 c) 9
d) None of these d) 2
10 Celect
100. In LINUX o.s the virtual address is of 106. Find the output
a) 24 bits void main()
b) 32 bits {
c) 64 bits int x=345,r,sum=0,i;
d) None of these if(x!=0)
{
101. Find the output.
r=x%10;
void main() sum+=r;
{ i=i/10;
unsigned int i=65535; }
printf(“%d”,i++ + ++i); printf(“%d”,sum);
} }
a) 0 a) 5
b) 65535 b) 12
c) Error, lvalue required c) Compilation error
d) None of these d) None of these
102. Find the output 107. Find the output
void main() void main()
{ {
enum color{red, green}; int x=-300;
enum colors{green,white}; unsigned char *p;
printf(“%d %d”,green,white); p=&x;
} printf(“%d”,*p++);
printf(“%d”,*p);
a) 1 1
}
b) 0 1
c) 1 0 a) 212 88
d) Compilation error b) 212 254
c) 128 172
103. Find the output.
d) None of these
void main()
108. Find the output
{
char ch=’\356’; void main()
printf(“%d”,ch); {
} float f;
f=5/2;
a) -18
printf(“%f %f”,f,5/2);
b) 18
}
c) Compiler error
d) None of these a) 2.5000 2.5000
b) 2.0000 2.0000
104. Find the output
c) 2.0000 Garbage value
void main() d) Both Outputs have garbage values
{
109. Find the output
enum values{x,y,z};
printf(“%d %d %d”,x++,y++,++z); void main()
} {
int p=7,q=9;
a) 012
p=p^q;
b) 013
q=q^p;
c) 123
printf(“%d %d”,p,q);
d) Compilation error
}
105. The synonym for an existing data type can be
a) 7 9
created using
b) 9 7
a) typedef c) 18 9
b) structure d) 14 7
c) enum
d) All of the above
Data Types 11
a) 0 2 a) 6
b) 1 2 b) 65529
c) 65536 2 c) 65528
d) None of these d) 7
a) 13106 a) 0
b) -1 b) 65
c) 65535 c) 1
d) 5 d) 66
147. Find the output if the input is ab 152. Find the output
void main() void main()
{ {
char c; printf(“%d”,4>>256);
while(c=getchar()!=’\n’) }
printf(“%d”,c);
a) 0
}
b) 4
a) 65 c) 16
b) 66 d) 32
c) 6566
153. Find the output
d) 11
void main()
148. Find the output
{
void main() int i=3,j=2,k=1;
{ printf(“%d/%d”);
float x=2.8,y=4; }
if(x%=y)
a) 1
printf(“Both are equal”);
b) 0
else
c) 3/2
printf(“Not equal”);
d) 1/2
}
154. Find the output if the input is 5 5.75
a) Both are equal
b) Not equal void main()
c) Compilation error {
d) None of these int i=1;
float f=2.25;
149. Find the output
scanf(“%d a %f”,&i,&f);
void main() printf(“%d %.2f”,i,f);
{ }
float j;
a) 1 2.25
j=1000*1000;
b) 5 5.75
printf(“%f”,j);
c) 5 2.25
}
d) None of these
a) 1000000
155. Find the output.
b) 16960.00000
c) Compilation error void main()
d) None of these {
float x=3.2;
150. Find the output
float y=2.2;
int i=40000; printf(“%.2f”,x/y);
void main() }
{
a) 1.45
printf(“%ld”,i);
b) 1.45 45 45
}
c) 1.50
a) 40000 d) Compilation error
b) -25536
156. Find the output
c) Garbage
d) None of these void main()
{
151. Which of the following escape sequences output
int x=0;
is only observed with the help of a printer?
printf(x+”YUinlakshya%d”,x=1);
a) \a , \t }
b) \b , \r
a) 1
c) \r , \v
b) YUinlakshya1
d) \f , \v
c) Uinlakshya1
d) Uinlakshya1
16 Celect
ANSWERS