|
-
October 28th, 2009, 08:34 PM
#1
Window autocloses
Hello I am a student taking a c++ class and our first assignment is to make a program that takes 5 numbers and adds them
now i have a basic outline but when it adds and displays the answer the window closes any thoughts
#include "stdafx.h"
int
main(void)
{
char first, middle, last;
int number_1;
int number_2;
int number_3;
int number_4;
int number_5;
int total_numbers;
printf("Program Written By Ryan Kiesel\nLast Updated October 28-2009\n\n\n ");
printf("\nType your Initials> ");
scanf( "%c%c%c", &first, &middle, &last);
printf("\nPress a Number> ");
scanf( "%d", &number_1);
printf("\nPress a Number> ");
scanf( "%d", &number_2);
printf("\nPress a Number> ");
scanf( "%d", &number_3);
printf("\nPress a Number> ");
scanf( "%d", &number_4);
printf("\nPress a Number> ");
scanf( "%d", &number_5);
total_numbers = number_1 + number_2 + number_3 + number_4 + number_5;
printf("\n\n Thank you for your submission %c%c%C your total was: %d\n", first, middle, last, total_numbers);
return(0);
}
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|