You are viewing a single comment's thread. Return to all comments →
why doesn't my program get it correct ? #include
int main() {
int num1,num2; float numb1,numb2; scanf("%d %d", &num1,&num2); scanf("%f %f", &numb1,&numb2); int sum1,sum2;
sum1 = num1 + num2; sum2 = num1 - num2; printf("%d %d\n", sum1,sum2); float temp1; temp1 = numb1 + numb2; printf("%.1f %.1f\n", temp1, numb2);
return 0;
}
Seems like cookies are disabled on this browser, please enable them to open this website
Sum and Difference of Two Numbers
You are viewing a single comment's thread. Return to all comments →
why doesn't my program get it correct ? #include
include
include
include
int main() {
sum1 = num1 + num2; sum2 = num1 - num2; printf("%d %d\n", sum1,sum2); float temp1; temp1 = numb1 + numb2; printf("%.1f %.1f\n", temp1, numb2);
}