0

Is it correct???If it is wrong plz tell me where is the correction??

#include <stdio.h> #include <conio.h> main() { int a,b,s; printf ("value of a= "); scanf ("%d",&a); printf ("value of b= "); scanf ("%d",&b); s=a+b; printf ("%d",s); return 0; }

19th Jun 2016, 5:11 AM
Md.Rakibul Hasan
Md.Rakibul Hasan - avatar
6 Answers
+ 2
this is c++ try this in c programming and specify return type in main function if you are using integer try int main () if wanna use this app try this code instead of that one #include <iostream> using namespace std; int main () { int a,b,s; cout <<"enter value of a"<<endl; cin>>a; cout <<"enter value of b"<<endl; cin>>b; s=a+b; cout <<s; return 0; }
21st Jun 2016, 9:09 AM
Tushar Chetan
Tushar Chetan - avatar
+ 1
what error r u getting? the code seems to be right
19th Jun 2016, 5:25 AM
Suhail Pappu
Suhail Pappu - avatar
+ 1
i just compiled ur code in cppDroid ! i didn't get any error
19th Jun 2016, 6:06 AM
Piyush Raj
Piyush Raj - avatar
0
When I write this code in this app it shows wrong output!!
19th Jun 2016, 5:34 AM
Md.Rakibul Hasan
Md.Rakibul Hasan - avatar
0
Are you coding in C or C++?! : )
19th Jun 2016, 6:22 AM
Klodian Lula
Klodian Lula - avatar
0
dude this app is only compatible for c++ and not C y dont u try starting with c++ directly it will be easy for u to learn any language coz c++ has oop concepts happy coding!!
19th Jun 2016, 8:15 AM
Suhail Pappu
Suhail Pappu - avatar