Click here to Skip to main content
15,867,704 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: To make an interacting user game on *Tower of hanoi* . Pin
Tarun Jha15-Jan-18 1:21
Tarun Jha15-Jan-18 1:21 
GeneralRe: To make an interacting user game on *Tower of hanoi* . Pin
David Crow15-Jan-18 2:42
David Crow15-Jan-18 2:42 
GeneralRe: To make an interacting user game on *Tower of hanoi* . Pin
Richard MacCutchan15-Jan-18 5:00
mveRichard MacCutchan15-Jan-18 5:00 
QuestionSort digits of number Pin
Anonygeeker14-Jan-18 22:41
Anonygeeker14-Jan-18 22:41 
AnswerRe: Sort digits of number Pin
CPallini14-Jan-18 23:00
mveCPallini14-Jan-18 23:00 
AnswerRe: Sort digits of number Pin
Richard MacCutchan14-Jan-18 23:06
mveRichard MacCutchan14-Jan-18 23:06 
Questionconversion error Pin
Anonygeeker14-Jan-18 20:28
Anonygeeker14-Jan-18 20:28 
AnswerRe: conversion error Pin
Jochen Arndt14-Jan-18 21:19
professionalJochen Arndt14-Jan-18 21:19 
It is your while loop that checks t1 which gets the number of hours assigned in the loop. With input 3663, t1 is set to 63 within the first loop iteration which is then processed and shown as "1:1".

Add the missing scanf() call at the end of the loop to read the next user input and remove the unnecessary lines:
scanf("%d", &t1);
while (t1 > 0){
    printf("%d\n", t1);
    t = t1 % 60;
    t1 = t1 / 60;
    printf("%d : %d\n", t1, t);
    scanf("%d", &t1);
}

AnswerRe: conversion error Pin
Richard MacCutchan14-Jan-18 21:36
mveRichard MacCutchan14-Jan-18 21:36 
QuestionI couldn't think a good title for this.Simple question Pin
Emrah Duatepe14-Jan-18 7:37
Emrah Duatepe14-Jan-18 7:37 
AnswerRe: I couldn't think a good title for this.Simple question Pin
Jochen Arndt14-Jan-18 21:37
professionalJochen Arndt14-Jan-18 21:37 
GeneralRe: I couldn't think a good title for this.Simple question Pin
Emrah Duatepe14-Jan-18 21:44
Emrah Duatepe14-Jan-18 21:44 
GeneralRe: I couldn't think a good title for this.Simple question Pin
Jochen Arndt14-Jan-18 22:18
professionalJochen Arndt14-Jan-18 22:18 
GeneralRe: I couldn't think a good title for this.Simple question Pin
Emrah Duatepe14-Jan-18 23:37
Emrah Duatepe14-Jan-18 23:37 
GeneralRe: I couldn't think a good title for this.Simple question Pin
Jochen Arndt15-Jan-18 0:20
professionalJochen Arndt15-Jan-18 0:20 
GeneralRe: I couldn't think a good title for this.Simple question Pin
Emrah Duatepe15-Jan-18 0:30
Emrah Duatepe15-Jan-18 0:30 
GeneralRe: I couldn't think a good title for this.Simple question Pin
Jochen Arndt15-Jan-18 0:48
professionalJochen Arndt15-Jan-18 0:48 
GeneralRe: I couldn't think a good title for this.Simple question Pin
Emrah Duatepe15-Jan-18 0:39
Emrah Duatepe15-Jan-18 0:39 
GeneralRe: I couldn't think a good title for this.Simple question Pin
Jochen Arndt15-Jan-18 0:54
professionalJochen Arndt15-Jan-18 0:54 
GeneralRe: I couldn't think a good title for this.Simple question Pin
Emrah Duatepe15-Jan-18 1:10
Emrah Duatepe15-Jan-18 1:10 
AnswerRe: I couldn't think a good title for this.Simple question Pin
Richard MacCutchan14-Jan-18 21:39
mveRichard MacCutchan14-Jan-18 21:39 
GeneralRe: I couldn't think a good title for this.Simple question Pin
Emrah Duatepe14-Jan-18 21:45
Emrah Duatepe14-Jan-18 21:45 
Questionfinding longest word Pin
Anonygeeker10-Jan-18 22:05
Anonygeeker10-Jan-18 22:05 
AnswerRe: finding longest word Pin
Richard MacCutchan10-Jan-18 22:25
mveRichard MacCutchan10-Jan-18 22:25 
GeneralRe: finding longest word Pin
Anonygeeker10-Jan-18 22:40
Anonygeeker10-Jan-18 22:40 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.