Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
23 views

Questions-Problem Solving Through Programming in C-MCQs On Data Handling - Set 1-20240612-0142

Uploaded by

SACHIN JEEVAN
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
23 views

Questions-Problem Solving Through Programming in C-MCQs On Data Handling - Set 1-20240612-0142

Uploaded by

SACHIN JEEVAN
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 3

*@Ac# is a type of ________________ data.

A) Symbolic
B) Alphanumeric
C) Alphabetic
D) Numeric
ANSWER: A
What is the range of a signed char variable in C?
A) 0 to 255
B) -128 to 127
C) 0 to 127
D) -128 to 255
ANSWER: B
Which type of conversion is NOT accepted?
A) From double to char
B) From negative int to char
C) From char to int
D) From float to char pointer
E) None of these
ANSWER: D
Which of the following is the correct output for the program given below?
#include <stdio.h>int main(){ double d = 2.25; printf("%e", d); printf(
"%f", d); printf("%g", d); printf("%lf\n", d); return 0 ;}
A) 2.2 2.50 2.50 2.5
B) 2.2e 2.25f 2.00 2.25
C) 2.250000e + 000 2.250000 2.25 2.250000
D) Error
ANSWER: C
Modulus for float could be achieved by?
A) mod(p, q);
B) fmod(p, q);
C) modulus(p, q);
D) p % q
E) None of these
ANSWER: B
What will be the output of the following C code?#include <stdio.h>void main()
{ float num = 0.2; printf("%d, ", num); printf("%f", num);}
A) Garbage value, 0.200000
B) 0.200000, Garbage value
C) Compilation Error
D) Runtime Error
E) None of these
ANSWER: A
Which data type is suitable for storing a number like this?25.00002500025
A) double
B) int
C) both int and double
D) float
E) None of these
ANSWER: A
What will be the output of the following C code?#include <stdio.h>void main()
{ float num = 0.3; if (num == 0.3) printf("LearnLogic Technologies");
else printf("LearnLogicify Technologies");}
A) LearnLogic Technologies
B) Logic
C) Compilation Error
D) Runtime Error
E) LearnLogicify Technologies
ANSWER: E
Which of the following % operation is invalid?
A) 2 % 4f;
B) 2 % 4l;
C) Both 2 % 4f; and 2 % 4l;
D) 2 % 4;
E) None of these
ANSWER: C
What will be the output of the following C code?#include <stdio.h>int main()
{ float fl = 15.621212121212; printf("%f", fl);}
A) 15.621212121212
B) Compilation Error
C) Garbage value
D) 15.621212
E) None of these
ANSWER: D
What will be the output of the following C
code? #include <stdio.h> int main() { float f = 'I'; printf("%f", f); r
eturn 0; }
A) Compilation Error
B) 1
C) 73.000000
D) Runtime Error
E) None of these
ANSWER: C
What will be the output of the following C code?#include<stdio.h>int main()
{ printf("%.0f", 4.89);}
A) 4.890000
B) 4.89
C) 4
D) 5
E) None of these
ANSWER: D
What will be the output of the following C code?#include<stdio.h>int main()
{ unsigned char chr; chr = 128; printf("%d\n", chr); return 0;}
A) 128
B) -128
C) None of the mentioned
D) Depends on the compiler
ANSWER: A
Select the odd one out with respect to type?
A) int
B) float
C) char
D) long
E) None of these
ANSWER: B
Which is correct with respect to the size of the data types?
A) double > char > int
B) char > int > float
C) int < char > float
D) char < int < double
E) None of these
ANSWER: D
Range of double is -1.7e-38 to 1.7e+38 (in 16 bit platform - Turbo C under DOS)
A) TRUE
B) FALSE
C) May Be
D) Can't Say
ANSWER: B
%f access specifier is used for ________.
A) Integral types
B) Floating type
C) Strings
D) All of above
E) None of these
ANSWER: B
What will be the output of the following C code?#include <stdio.h>int main()
{ float num = 0.2; if (num == 0.2f) { printf("Equal\n"); } el
se { printf("Not Equal\n"); }}
A) Equal
B) Not Equal
C) Output depends on compiler
D) Compilation Error
E) None of these
ANSWER: A
What is the output of this program?#include<stdio.h>void main(){ int c = - -
14; printf("%d", c); }
A) 13
B) 14
C) -14
D) Compilation Error
ANSWER: B
Loss in precision occurs for typecasting from____________
A) float to int
B) long to float
C) float to double
D) char to short
E) None of these
ANSWER: A

You might also like