Logo 
Search:

C Programming Articles

Submit Article
Home » Articles » C Programming » Homework HelpRSS Feeds

Program to compute total minutes from given hours and minutes

Posted By: Charlie Evans     Category: C Programming     Views: 8186

Write a program to compute total minutes from given hours minutes.

Code for Program to compute total minutes from given hours and minutes in C Programming

#include<stdio.h>

void main()
{

        int hour,minute,minute1,total;
        printf("Hrs:");
        if(scanf("%d",&hour)==1)
        {
                printf("Mins:");
                if(scanf("%d",&minute)==1)
                {
                        minute1=hour*60;
                        total=minute1+minute;
                        printf(" total minutes=> %d",total);
                }
                else
                {
                        printf("error ,enter correct value");
                }
        }
        else
        {
                printf("Error,enter correct value");
        }

}


================================OUTPUT===========================
Hrs :12
Mins:30
Total minutes=> 750
  
Share: 



Charlie Evans
Charlie Evans author of Program to compute total minutes from given hours and minutes is from London, United Kingdom.
 
View All Articles

 
Please enter your Comment

  • Comment should be atleast 30 Characters.
  • Please put code inside [Code] your code [/Code].

 
Andrew Cultivo from United States Comment on: Jul 18
hi ! please help me with this questions, code for dev c++
the 2004 phoenix Suns won 63 games and lost 18 games, Computer their winning percentage and print it.

please thanks!

Andrew Cultivo from United States Comment on: Jul 18
hi ! please help me with this questions,
the 2004 phoenix Suns won 63 games and lost 18 games, Computer their winning percentage and print it.

please thanks!

View All Comments