+ 1
Printf("the answer is %d",sum); does not work on devc++ on my PC what can i do to fix it please
Printf("the answer is %d",sum);
4 odpowiedzi
+ 2
Maybe you have no compiler warnings enabled in your environment. Can you try it in SoloLearns Code Playground? If the type is wrong, you will get a warning.
If that doesn't help... Maybe you can share that part of your code here.
+ 1
What is the error you get?
Might be, that
- you did not #include <cstdio>
- you actually typed "Printf" instead of "printf"
- sum is of wrong type
0
I get something like 0.0000000 instead of the actual value
0
#include <stdio.h>
int main() {
int a,b,sum;
printf("Enter two values\n");
scanf("%d%d",&a,&b);
sum=a+b;
printf ("answer is %d",sum);
return 0;
}
This is the code