Floating Point Issues - General Questions Multiple Questions and Answers.




1.What are the different types of real data type in C ?
A. float, double
B. short int, double, long int
C. float, double, long double
D. double, long int, float

2.What will you do to treat the constant 3.14 as a long double?
A. use 3.14LF
B. use 3.14DL
C. use 3.14L
D. use 3.14LD

3.Which statement will you add in the following program to work it correctly?
#include<stdio.h>
int main()
{
    printf("%f\n", log(36.0));
    return 0;
}
A. # include < conio.h >
B. # include < math.h >
C. # include< stdlib.h >
D. # include< dos.h >

4.We want to round off x, a float, to an int value, The correct way to do is?
A. y = (int)(x + 0.5)
B. y = int(x + 0.5)
C. y = (int)x + 0.5
D. y = (int)((int)x + 0.5)

5.The binary equivalent of 5.375 is?
A. 101.101110111
B. 101.011
C. 101011
D. All of above

»



Date to Date Current Affairs 2022

PakMCQs.net

Quick Links

GAT Subject



   Computer Science    English Mcqs    Agriculture    

Engineering



   Computer Science    Civil Engineering    

Technical



   Networking    Electronics    Database    

Past Papers



   Model Papers    FPSC Papers