We're a community of 1077K IT Pros here for help, advice, solutions, professional growth and fun. Join us!
1,076,018 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Start New Discussion Reply to this Discussion

Programming

I need help writing a program that declares a minutes variable to represent minutes worked on a job, and assign a value to it. Display the value in hours and minutes. For example, 197 minutes becomes 3 hours and 17 minutes. Unfortunately, I don't know much about programming...so, any information would be helpful.

5
Contributors
4
Replies
20 Hours
Discussion Span
3 Months Ago
Last Updated
5
Views
Mz. Jackee
Newbie Poster
7 posts since Sep 2011
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0
#include<stdio.h>
int main()
{
    int a,b,c;
    printf("minutes:");
    scanf("%d",&a);
    printf("%d hour %d minutes",a/60,a%60);
    return 0;
}

this is the C program to do your job.

abrarfaiyaztasin
Newbie Poster
1 post since Jan 2013
Reputation Points: 7
Solved Threads: 0
Skill Endorsements: 0

Why not share your code so we can help you with it? we are not doing your work...

<M/>
Senior Poster
3,611 posts since Apr 2012
Reputation Points: 64
Solved Threads: 78
Skill Endorsements: 90

Why not learn something about division ande remainder operators in C#? Learn!

ddanbe
Industrious Poster
4,293 posts since Oct 2008
Reputation Points: 2,121
Solved Threads: 723
Skill Endorsements: 26

Learning about the Timespan Structure would simplify what you need to do.

tinstaafl
Nearly a Posting Virtuoso
1,326 posts since Jun 2010
Reputation Points: 355
Solved Threads: 230
Skill Endorsements: 14

This article has been dead for over three months: Start a new discussion instead

Post: Markdown Syntax: Formatting Help
 
You
 
© 2013 DaniWeb® LLC
Page rendered in 0.0693 seconds using 2.69MB