Functions in C | HackerRank - Samsus Salehin Sabbir

Header Ads

Functions in C | HackerRank


Problem Link : Functions in C

Solution :
      Develop by
 Samsus Salehin Sabbir 



  1. #include <stdio.h>
  2. int max(int a,int b)
  3. {
  4.     return (a>b) ? a:b;
  5.     
  6. }

  7. int main() {
  8.     int a, b, c, d; // declear
  9.     scanf("%d %d %d %d", &a, &b, &c, &d);
  10.     int x = max(a,b);
  11.     int y = max(x,c);
  12.     int z = max(y,d);
  13.     
  14.     printf("%d\n", z);
  15.     
  16.     return 0;
  17. }

No comments

Powered by Blogger.