Advertisement
nguyenhappy92

Tính và xuất tổng, hiệu, tích, thương

Oct 16th, 2015
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. // Tinh tong hieu tich thuong 2 so
  2. // Khai bao cac ham thu vien chuong trinh
  3.  
  4. #include<stdio.h>
  5. #include<conio.h>
  6.  
  7. void main()
  8. {
  9. int a,b;
  10. scanf("%d%d",&a,&b);
  11. printf(" Tong 2 chu so: %d\n",a+b);
  12. printf(" Hieu 2 chu so: %d\n",a-b);
  13. printf(" Tich 2 chu so: %d\n",a*b);
  14. if(a==0||b==0)
  15. {
  16. printf("0");
  17. }
  18. else
  19. {
  20. printf(" Thuong 2 chu so: %.2f",(float)a/b);
  21. }
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement