Click here to Skip to main content
15,881,803 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Questionmy problem is output for this weight conversion pounds to kilogram that starts from 100 to 300. Pin
Member 1563347212-May-22 0:17
Member 1563347212-May-22 0:17 
AnswerRe: my problem is output for this weight conversion pounds to kilogram that starts from 100 to 300. Pin
OriginalGriff12-May-22 0:26
mveOriginalGriff12-May-22 0:26 
QuestionRe: my problem is output for this weight conversion pounds to kilogram that starts from 100 to 300. Pin
Member 1563347212-May-22 0:43
Member 1563347212-May-22 0:43 
AnswerRe: my problem is output for this weight conversion pounds to kilogram that starts from 100 to 300. Pin
Richard Deeming12-May-22 0:54
mveRichard Deeming12-May-22 0:54 
AnswerRe: my problem is output for this weight conversion pounds to kilogram that starts from 100 to 300. Pin
Michael Hulthin12-May-22 1:06
Michael Hulthin12-May-22 1:06 
GeneralRe: my problem is output for this weight conversion pounds to kilogram that starts from 100 to 300. Pin
Member 1563347212-May-22 1:21
Member 1563347212-May-22 1:21 
GeneralRe: my problem is output for this weight conversion pounds to kilogram that starts from 100 to 300. Pin
Member 1563347212-May-22 1:44
Member 1563347212-May-22 1:44 
GeneralRe: my problem is output for this weight conversion pounds to kilogram that starts from 100 to 300. Pin
Michael Hulthin12-May-22 1:59
Michael Hulthin12-May-22 1:59 
Well it is, kindof. Smile | :) The format specfier to printf is wrong.
Try this
#include <stdio.h>
#define POUNDTOKG  0.453592

int main() {
  printf("Pound --------- Kilos\n\n");
  for (int pound = 100; pound <= 300; pound++) {
    printf("%d pound = %.2f Kilogram\n", pound, pound * POUNDTOKG);
  }
  return 0;
}
Pound --------- Kilos

100 pound = 45.36 Kilogram
101 pound = 45.81 Kilogram
102 pound = 46.27 Kilogram
103 pound = 46.72 Kilogram
...
298 pound = 135.17 Kilogram
299 pound = 135.62 Kilogram
300 pound = 136.08 Kilogram


...Program finished with exit code 0
Press ENTER to exit console.

GeneralRe: my problem is output for this weight conversion pounds to kilogram that starts from 100 to 300. Pin
Member 1563347212-May-22 2:16
Member 1563347212-May-22 2:16 
Questionhow to capture mouse movement and click in windows service Pin
Shkuratov U11-May-22 16:57
Shkuratov U11-May-22 16:57 
AnswerRe: how to capture mouse movement and click in windows service Pin
Richard MacCutchan11-May-22 21:43
mveRichard MacCutchan11-May-22 21:43 
AnswerRe: how to capture mouse movement and click in windows service Pin
Richard Deeming11-May-22 21:44
mveRichard Deeming11-May-22 21:44 
Questionconflicting types for 'uint32_t' issue Pin
focusdoit5-May-22 3:17
focusdoit5-May-22 3:17 
AnswerRe: conflicting types for 'uint32_t' issue Pin
Richard MacCutchan5-May-22 4:02
mveRichard MacCutchan5-May-22 4:02 
AnswerRe: conflicting types for 'uint32_t' issue Pin
Randor 5-May-22 9:28
professional Randor 5-May-22 9:28 
GeneralRe: conflicting types for 'uint32_t' issue Pin
focusdoit5-May-22 14:04
focusdoit5-May-22 14:04 
GeneralRe: conflicting types for 'uint32_t' issue Pin
Randor 5-May-22 14:31
professional Randor 5-May-22 14:31 
GeneralRe: conflicting types for 'uint32_t' issue Pin
Richard MacCutchan5-May-22 22:23
mveRichard MacCutchan5-May-22 22:23 
QuestionComplier error C2280 explanation Pin
ForNow5-May-22 1:37
ForNow5-May-22 1:37 
AnswerRe: Complier error C2280 explanation Pin
CPallini5-May-22 1:59
mveCPallini5-May-22 1:59 
GeneralRe: Complier error C2280 explanation Pin
ForNow5-May-22 2:07
ForNow5-May-22 2:07 
GeneralRe: Complier error C2280 explanation Pin
CPallini5-May-22 2:10
mveCPallini5-May-22 2:10 
GeneralRe: Complier error C2280 explanation Pin
ForNow5-May-22 2:21
ForNow5-May-22 2:21 
GeneralRe: Complier error C2280 explanation Pin
CPallini5-May-22 2:34
mveCPallini5-May-22 2:34 
GeneralRe: Complier error C2280 explanation Pin
ForNow5-May-22 3:01
ForNow5-May-22 3:01 

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.