Compaq Visual Fortran Professional Edition 6.6 (QB-5UDAB-PA) for PC Logo

Related Topics:

Posted on Oct 30, 2010

Write a program to sum of all even integer numbers

1 Answer

Anonymous

Level 1:

An expert who has achieved level 1.

MVP:

An expert that got 5 achievements.

New Friend:

An expert that has 1 follower.

Hot-Shot:

An expert who has answered 20 questions.

  • Contributor 24 Answers
  • Posted on Nov 24, 2010
Anonymous
Contributor
Level 1:

An expert who has achieved level 1.

MVP:

An expert that got 5 achievements.

New Friend:

An expert that has 1 follower.

Hot-Shot:

An expert who has answered 20 questions.

Joined: Mar 30, 2010
Answers
24
Questions
0
Helped
11239
Points
43

#include <iostream>
using namespace std;
int main ()
{
int num = 0, i = 1, sum = 0;
cout << "Enter a positive integer: ";
cin >> num;
while (i <= num)
{
sum += i;
i++;
}
cout << "The sum is " << sum << endl;
return 0;
}

Add Your Answer

×

Uploading: 0%

my-video-file.mp4

Complete. Click "Add" to insert your video. Add

×

Loading...
Loading...

151 views

Ask a Question

Usually answered in minutes!

Top Compaq Computers & Internet Experts

Sudeep Chatterjee
Sudeep Chatterjee

Level 3 Expert

3269 Answers

Grand Canyon Tech
Grand Canyon Tech

Level 3 Expert

3869 Answers

Frank Fernandez

Level 3 Expert

791 Answers

Are you a Compaq Computer and Internet Expert? Answer questions, earn points and help others

Answer questions

Manuals & User Guides

Loading...