Sum and Difference of Two Numbers | HackerRank - Samsus Salehin Sabbir

Header Ads

Sum and Difference of Two Numbers | HackerRank


Problem Link : Sum and Difference of Two Numbers

Solution :
      Develop by
 Samsus Salehin Sabbir


  1. #include <stdio.h>
  2. #include <string.h>
  3. #include <math.h>
  4. #include <stdlib.h>

  5. int main()
  6. {
  7. int num1,num2;
  8.         float num3,num4;
  9.         scanf("%d %d",&num1,&num2);
  10.         printf("%d %d\n",num1+num2,num1-num2);
  11.         scanf("%f %f",&num3,&num4);
  12.         printf("%.1f %.1f\n",num3+num4,num3-num4);
  13.     
  14.     return 0;
  15. }

No comments

Powered by Blogger.