+ 3

What will this program execute?

#include<stdio.h> int main() { float a=1.1; double b=1.1; if (a==b) printf("Programming geeks"); else printf("Programming is epic."); }

14th Oct 2017, 11:17 PM
Adrija Ray Chaudhuri
Adrija Ray Chaudhuri - avatar
8 Answers
+ 6
An error. you used print instead of printf I agree with you though!😾 https://code.sololearn.com/cb2zyWiI25rG/?ref=app
14th Oct 2017, 11:38 PM
Manual
Manual - avatar
+ 5
I have a question.As you said,value of float a is promoted to datatype double.Can C do that?Can C promote one datatype to another and compare their values?Sorry If I have been very stupid with my question
14th Oct 2017, 11:50 PM
Adrija Ray Chaudhuri
Adrija Ray Chaudhuri - avatar
+ 2
That print was my typing error.Sincerely apologise.
14th Oct 2017, 11:44 PM
Adrija Ray Chaudhuri
Adrija Ray Chaudhuri - avatar
0
you have mentioned an int return type but didn't return integer value..
15th Oct 2017, 2:52 PM
mr sandeep
mr sandeep - avatar
0
I ran it on D'coder It outputs, 'Programming geeks'
15th Oct 2017, 3:11 PM
Adrija Ray Chaudhuri
Adrija Ray Chaudhuri - avatar