Click here to Skip to main content
15,890,512 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: calculation error Pin
CPallini14-Oct-09 5:37
mveCPallini14-Oct-09 5:37 
GeneralRe: calculation error Pin
kbury14-Oct-09 5:43
kbury14-Oct-09 5:43 
GeneralRe: calculation error Pin
CPallini14-Oct-09 7:04
mveCPallini14-Oct-09 7:04 
AnswerRe: calculation error Pin
David Crow14-Oct-09 7:39
David Crow14-Oct-09 7:39 
AnswerRe: calculation error [modified] Pin
Patcher3214-Oct-09 12:52
Patcher3214-Oct-09 12:52 
AnswerRe: calculation error Pin
Luc Pattyn14-Oct-09 13:41
sitebuilderLuc Pattyn14-Oct-09 13:41 
GeneralRe: calculation error Pin
kbury15-Oct-09 5:07
kbury15-Oct-09 5:07 
GeneralRe: calculation error Pin
Luc Pattyn15-Oct-09 5:38
sitebuilderLuc Pattyn15-Oct-09 5:38 
Hi,

not tested:

// read a number, return it in delta; return TRUE if more to be handled, FALSE when done (with delta=0!)
float getNumber(char* prompt, float* delta) {
    float number;
    printf(prompt);
    scanf("%f", number);
    ... add whatever checking you consider important
    *delta=number;
    return number!=0;
}

int main(void) {
    float balance, delta;
    int more;
    printf("BANK RECONCILIATION FOR: 10/21/98");
    printf("\n\nEnding balance on statement:");
    scanf("%f", &balance);
    do {
        more=getNumber("Enter Outstanding dep (or 0 to quit)", &delta);
        balance+=delta;
    while(more);
    do {
        more=getNumber("Outstanding check/withdrawal (or 0 to quit)");
        balance-=delta;
    while(more);
    printf("Your final balance in your checkbook should be $ %f" , balance);
    return 0;
}


Smile | :)

Luc Pattyn

I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages

Local announcement (Antwerp region): Lange Wapper? Neen!


QuestionHow to convert the vbscript to c++ using adsi Pin
raja 414-Oct-09 4:59
raja 414-Oct-09 4:59 
AnswerRe: How to convert the vbscript to c++ using adsi Pin
David Crow15-Oct-09 3:15
David Crow15-Oct-09 3:15 
QuestionEnabling and Disadbling Toolbar Buttons. Pin
hariakuthota14-Oct-09 4:43
hariakuthota14-Oct-09 4:43 
AnswerRe: Enabling and Disadbling Toolbar Buttons. Pin
CPallini14-Oct-09 5:27
mveCPallini14-Oct-09 5:27 
QuestionProblem in C++ Template definition Pin
gourishsio14-Oct-09 4:32
gourishsio14-Oct-09 4:32 
AnswerRe: Problem in C++ Template definition Pin
CPallini14-Oct-09 5:24
mveCPallini14-Oct-09 5:24 
AnswerRe: Problem in C++ Template definition [modified] Pin
Stuart Dootson14-Oct-09 6:19
professionalStuart Dootson14-Oct-09 6:19 
QuestionCreating a Status Bar in DialogBased Application Pin
Hari_1614-Oct-09 3:49
Hari_1614-Oct-09 3:49 
AnswerRe: Creating a Status Bar in DialogBased Application Pin
Roger Stoltz14-Oct-09 4:47
Roger Stoltz14-Oct-09 4:47 
AnswerRe: Creating a Status Bar in DialogBased Application Pin
David Crow14-Oct-09 7:52
David Crow14-Oct-09 7:52 
GeneralRe: Creating a Status Bar in DialogBased Application Pin
Hari_1614-Oct-09 18:01
Hari_1614-Oct-09 18:01 
GeneralRe: Creating a Status Bar in DialogBased Application Pin
David Crow15-Oct-09 3:09
David Crow15-Oct-09 3:09 
QuestionHow to convert real to binary Pin
Aljaz11114-Oct-09 3:09
Aljaz11114-Oct-09 3:09 
AnswerRe: How to convert real to binary Pin
Iain Clarke, Warrior Programmer14-Oct-09 3:22
Iain Clarke, Warrior Programmer14-Oct-09 3:22 
AnswerRe: How to convert real to binary Pin
Cedric Moonen14-Oct-09 4:18
Cedric Moonen14-Oct-09 4:18 
AnswerRe: How to convert real to binary Pin
CPallini14-Oct-09 5:05
mveCPallini14-Oct-09 5:05 
GeneralRe: How to convert real to binary Pin
Aljaz11114-Oct-09 6:26
Aljaz11114-Oct-09 6:26 

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.