Home / Programming Questions / C Programming MCQs / Page 3

C Programming MCQs with answers Page - 3

Dear candidates you will find MCQ questions of C Programming here. Learn these questions and prepare yourself for coming examinations and interviews. You can check the right answer of any question by clicking on any option or by clicking view answer button.
Share your questions by clicking Add Question

A

Akash Lawaniya • 9.48K Points
Tutor III

Q. What will be the output of the following C code?

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

A

Akash Lawaniya • 9.48K Points
Tutor III

Q. What will be the output of the following C code?

Code:
#include 
    printf("%.0f", 4.89);
(A) 4.890000
(B) 4.89
(C) 4
(D) 5

A

Akash Lawaniya • 9.48K Points
Tutor III

Q. Select the odd one out with respect to type?

(A) int
(B) float
(C) char
(D) long

A

Akash Lawaniya • 9.48K Points
Tutor III

Q. %f access specifier is used for ________.

(A) Integral types
(B) Floating type
(C) Strings
(D) All of above

A

Akash Lawaniya • 9.48K Points
Tutor III

Q. In the following C code, the union size is decided by?

Code:
union temp
    {
        char ch;
        int n;
        float f;
    };
(A) float
(B) int
(C) both float and int
(D) char

A

Akash Lawaniya • 9.48K Points
Tutor III

Q. Loss in precision occurs for typecasting from____________.

(A) float to int
(B) long to float
(C) float to double
(D) char to short

A

Akash Lawaniya • 9.48K Points
Tutor III

Q. What is the size of float in a 32-bit compiler?

(A) 8
(B) 4
(C) 2
(D) 1

A

Akash Lawaniya • 9.48K Points
Tutor III

Q. In a 32-bit compiler, which 2 types have same size?

(A) float and double
(B) short and int
(C) char and short
(D) int and float

Login

Forgot username? click here

Forgot password? Click here

Don't have account? Register here.