Answer to Question #34015 in C++ for Harkirat Singh

Question #34015
Write a c++ program to find the sum of 0.123  103 and 0.456  102 and write the result in
three significant digits.
1
Expert's answer
2013-08-22T11:52:38-0400
#include <stdio.h>
#include <stdlib.h>
//main function
int main(int argc, char *argv[]){
double sum;//variable for sum
sum=0.123+103;//add
printf("%.3f
",sum);//%.3f mean significant digits
sum= 0.456 +102;//add
printf("%.3f
",sum);//%.3f mean significant digits
system("PAUSE");//delay
return 0;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
APPROVED BY CLIENTS