Wednesday, September 12, 2018

TIME UP!

  • Problem Description

    Kamalesh wish to know how the time is converted from seconds to hours, minutes and seconds. Your task is to write C program for this conversion.
  • CODING ARENA::
  • #include <stdio.h>
    int main()
    {
      int a,h,m,s;
      scanf("%d",&a);
      m=a/60;
      s=a%60;
      h=m/60;
      m=m%60;
      printf ("%d %d %d",h,m,s);

    return 0;
    }
  • Test Case 1

    Input (stdin)
    7302
    
    
    Expected Output
    2 1 42
  • Test Case 2

    Input (stdin)
    652
    
    
    Expected Output
    0 10 52

No comments:

Post a Comment