Input / Output - Find Output of Program :: Discussion


3.What will be the output of the program?
A.3.00
B.3.15
C.3.2
D.3
Answer:  Option  C
Explanation:

float a=3.15529; The variable a is declared as an float data type and initialized to value 3.15529;

printf("%2.1f\n", a); The precision specifier tells .1f tells the printf function to place only one number after the .(dot).

Hence the output is 3.2

Tutorial Link:
Published by:Michael Daani

Comments are not available

Post your comments here:

Optional

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