Using a while loop and arithmetic?

Hello everyone, newbie here =)

I'm currently doing some programming work for my programming module for my degree course and i'm completely stuck on some of the exercises involving while, for, if and else loops etc...

Basically I have to write a program that converts minutes into "hours and minutes" and use a while loop so i'm able to enter values repeatedly and terminate if a value of zero is entered?

This is what I have have so far...

1
2
3
4
5
6
7
8
9
10
11
12
13
14
#include <stdio.h>
{
	int main(void)
	while (minutes > 0)
	{
		int minutes;
		float hours;
		hours = minutes / 60
		printf("Enter time in minutes here: ");
		scanf("%d", &minutes);
		printf("The time in hours and minutes is %1.f", &hours);
	}
		
}


I think i'm going about this completely wrong but if anyone can help me I would really appreciate it =)

Thanks.
Do your arithmetic after you ask for the number (move line 8 to line 11).
Topic archived. No new replies allowed.