Advertisement
Guest User

AUNIK HASAN MRIDUL 191-15-2732

a guest
May 23rd, 2019
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.59 KB | None | 0 0
  1. #Subtraction
  2. #include<stdio.h>
  3. int main()
  4. {
  5.     int a,b,sum;
  6.     scanf("%d %d",&a,&b);
  7.     sum = abs(a-b);
  8.     printf("sum = %d",sum);
  9.     return 0;
  10.  
  11. }
  12.  
  13. #SWAPING
  14. #include<stdio.h>
  15. int main()
  16. {
  17.     int a,b;
  18.     scanf("%d %d",&a,&b);
  19.     int temp=a;
  20.     a=b;
  21.     b=temp;
  22.     printf("a=%d,b=%d",a,b);
  23.     return 0;
  24. }
  25.  
  26.  
  27. #include<stdio.h>
  28. int main()
  29. {
  30.     int a,b;
  31.     scanf("%d %d",&a,&b);
  32.     a = a+b;
  33.     b =a-b;
  34.     a=a-b;
  35.     printf("a=%d,b=%d",a,b);
  36.     return 0;
  37.  
  38. }
  39.  
  40. #WITHOUT_TEMP
  41. #include<stdio.h>
  42. int main()
  43. {
  44.     double u,a,t,s;
  45.     scanf("%lf %lf %lf",&u,&a,&t);
  46.     s=u*t+0.5*a*t*t;
  47.     printf("s=%lf",s);
  48.     return 0;
  49. }
  50.  
  51.  
  52. #GREATEST_NUMBER
  53. #include<stdio.h>
  54. int main()
  55. {
  56.     int a,b,c;
  57.     scanf("%d %d %d",&a,&b,&c);
  58.     if((a>b)&&(a>c)){
  59.         printf("%d is the maximum number",a);
  60.     }
  61.     else if((b>a)&&(b>c)){
  62.         printf("%d is the maximum number",b);
  63.     }
  64.     else{
  65.         printf("%d is the maximum number",c);
  66.     }
  67.     return 0;
  68. }
  69.  
  70. #GREATEST_NUMBER_LOOP
  71. #include<stdio.h>
  72. int main()
  73. {
  74.     int a,b,c;
  75.     scanf("%d %d %d",&a,&b,&c);
  76.     if(a>b){
  77.         if(a>c){
  78.             printf("%d is the maximum number",a);
  79.         }
  80.         else{printf("%d is the maximum number",c);}
  81.     }
  82.     else{
  83.         if(b>a){if(b>c){
  84.             printf("%d is the maximum number",b);
  85.         }
  86.         else{printf("%d is the maximum number",c);}
  87.  
  88.         }
  89.     }
  90. }
  91.  
  92.  
  93.  
  94. #UVA_10071
  95. #include<stdio.h>
  96. int main()
  97. {
  98.     int s,v,t;
  99.     while(scanf("%d %d",&v,&t)!=EOF)
  100.     {
  101.         printf("%d\n",2*v*t);
  102.     }
  103.      return 0;
  104.  
  105. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement