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.

Recommended Answers

All 4 Replies

#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.

commented: Not C# -1
commented: I like the irony of giving him an answer he can't use. It is also correct and the poster did ask for *any* information. I would therefore add that this poster did indeed answer the op's question as it was asked. +8

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

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

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.