+ 1

i am not getting the results. why?

#include <stdio.h> #include <conio.h> void main() { int a,b,sum; printf ("Enter first number:"); scanf ("%d",&a); printf ("Enter second number:"); scanf ("%d",&b); sum=a+b; printf ("summation=%d",sum); getch(); }

4th Mar 2018, 4:38 PM
lamia
lamia - avatar
2 Answers
+ 4
well I guess you tried this on sololearn code playground or any modern IDE and If you did so , then there is no chance that it's gonna work. First thing <conio.h> is no more supported and that means you can't use any of it's functions too so using void main and getch() is useless. Just edit it and little bit , remove that #include<conio.h> , replace void main() by int main() and getch(); by return 0; it'll work successfully .
4th Mar 2018, 5:30 PM
RZK 022
RZK 022 - avatar
+ 1
thanks a lot.....
5th Mar 2018, 2:38 PM
lamia
lamia - avatar