CameraIcon
CameraIcon
SearchIcon
MyQuestionIcon
MyQuestionIcon
1
You visited us 1 times! Enjoying our articles? Unlock Full Access!
Question

What will this program display?
# include <Stdio.h>
main ()
{float f;
f = 10/3
printf ('%f', f);}

A
3.3
No worries! We‘ve got your back. Try BYJU‘S free classes today!
B
3.0
Right on! Give the BNAT exam to get a 100% scholarship for BYJUS courses
C
3
No worries! We‘ve got your back. Try BYJU‘S free classes today!
D
3.1
No worries! We‘ve got your back. Try BYJU‘S free classes today!
Open in App
Solution

The correct option is C 3.0

# include <Stdio.h>
main ()
{float f;
f = 10/310/3

printf ('%f', f);}

Float is a term is used in various programming languages to define a variable with a fractional value. Numbers created using a float variable declaration will have digits on both sides of a decimal point.

So, the output is 3.0.


flag
Suggest Corrections
thumbs-up
0
Join BYJU'S Learning Program
similar_icon
Related Videos
thumbnail
lock
Characteristics of Bohr's Model
MATHEMATICS
Watch in App
Join BYJU'S Learning Program
CrossIcon