TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Abdalla Elawad
NA
1k
215.3k
how to sum even numbers less than entry number ?
Aug 5 2018 1:43 AM
hi guys
please help me
This is program use c++ i need to sum numbers less than entry numbers i try to print even numbers less than entry but how to sum it ?
#include
using namespace std;
int main() {
/* Initialize i with 1. */
int i;
int n ;
cout << "Enter Number : ";
cin >> n; //take user input
/* If i is less than or equal to 100. */
while( i <= n){
/* If number is divisible by 2, then print.*/
if(i % 2 == 0){
cout <
}
/* Increment i. */
i++;
}
return 0;
}
Reply
Answers (
5
)
Notification bar icons.
MVC web application