-
October 23rd, 2009, 02:38 AM
#1
Need help with this coding plzz
Write a C program which takes number of integers to sum and gives following output:
Enter the number of integers you want to sum: 5
1 = 1
1+2 = 3
1+2+3 = 6
1+2+3+4 = 10
1+2+3+4+5 = 15
remember v can use only iostream and the loops v can use are for loops,while and do while loops...
for condition if else can also b used...thank u
-
October 23rd, 2009, 03:07 AM
#2
Re: Need help with this coding plzz
Victor Nijegorodov
-
October 23rd, 2009, 03:32 AM
#3
Re: Need help with this coding plzz
i am sorry ... but i have done some of the program but am confused on a part ?? can i ask about that part???
-
October 23rd, 2009, 03:37 AM
#4
Re: Need help with this coding plzz
You can ask what you're stuck on, but posting your code as well will get you help faster
Also use the code tag
0100 0111 0110 1111 0110 0100 0010 0000 0110 1001 0111 0011 0010 0000 0110 0110 0110 1111 0111 0010
0110 0101 0111 0110 0110 0101 0111 0010 0010 0001 0010 0001 0000 0000 0000 0000 0000 0000 0000 0000
-
October 23rd, 2009, 03:47 AM
#5
Re: Need help with this coding plzz
actually i was helping my younger brother... and i came up with this code but he says he hasnt used system and namespace in his studies yet....
#include <iostream>
using namespace std;
int main()
{
int input, output = 0;
cout << "Enter an integer: ";
cin >> input;
for( int i = input; i > 0; i-- )
output += i;
cout << output;
system("PAUSE");
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
|