C Programming and Problem Solving Questions and Answers 291 to 300

C Programming and Problem Solving

Questions 291 to 300



291.
The size of an int must be greater than or equal to that of a
(a)
long int
(b)
short int
(c)
float
(d)
double
(e)
char.
292.
What is the output of the following statements?
int b=5,c=15,d=8,e=8,a;
a=b>c?c>d?12:d>e?13:14:15;
printf(“%d”,a);
(a)
13
(b)
14
(c)
15
(d)
16
(e)
Garbage value.
293.
Which of the following is not a correct variable type?
(a)
float
(b)
real
(c)
int
(d)
double
(e)
long.
294.
Which of the following is a complete function?
(a)
int funct();
(b)
int funct(int x) {return x=x+1;}
(c)
void funct(int) {cout<<"Hello"}
(d)
void funct(x) {cout<<"Hello"}
(e)
funct( );.
295.
What is the result of the program?
main()
{
int a = 1000, b = 1000;
long int c = a * b;
printf(“%ld”, c);
}
(a)
1000000
(b)
10000
(c)
100000
(d)
Garbage value
(e)
1000.
296.
A file opened in W+ mode can be used in
(a)
Read-write
(b)
Write-read
(c)
Only write
(d)
Only read
(e)
Append.
297.
Which of the following function is used to detect the end of the file?
(a)
feof()
(b)
ferror()
(c)
fputs()
(d)
fgetch()
(e)
freach().
298.
The structure combines variables of
(a)
Dissimilar user-defined data types
(b)
Similar data types
(c)
Unsigned data types
(d)
Signed data types
(e)
Similar signed data types.
299.
Identify the most appropriate sentence to describe Unions.
(a)
Unions contain members of different data types which share the same storage area in memory
(b)
Union are like structures
(c)
Unions are less frequently used in the program
(d)
Unions are used for set operations
(e)
Unions are used for pointers.
300.
Each case statement in switch () is separated by
(a)
break
(b)
continue
(c)
exit()
(d)
go to
(e)
loop.

Answers


291.
Answer : (b)
Reason:  The size of an int must be greater than or equal to that of a short int.
292.
Answer : (c)
Reason:  15 is the required output.
293.
Answer : (b)
Reason:  Real is not a correct variable type.
294.
Answer : (b)
Reason:  int funct(int x) {return x=x+1;} is a complete function.
295.
Answer : (d)
Reason:  Garbage value is displayed as a result.
296.
Answer : (b)
Reason:  A file opened in W+ mode can be used in Write-read.
297.
Answer : (a)
Reason:  feof() function is used to detect the end of the file.
298.
Answer : (a)
Reason:  The structure combines variables of dissimilar user-defined data types.
299.
Answer : (a)
Reason:  Unions contain members of different data types which share the same storage area in memory is the most appropriate sentence to describe Unions.
300.
Answer : (a)
Reason:  Each case statement in switch () is separated by break.



<< Prev 1...  2...  3...  4...  5...  6...  7...  8...  9...  10...  11... 12...  13...  14...  15...  16...  17...  18...  19...  20...  21...  22...  23...  24...  25...  26...  27...  28...  29...  30...  31...  32...  33...  34...  35...  36...  Next >>


No comments :

What you think about these Questions and Answers ? Let me know in comments.

Post a Comment