write a C++ program to print all the even numbers between 1 and 50 using while, do-while and for loop.The format of the report must be applied towhile, do-while and for loop. And keep the details of...

1 answer below »
write a C++ program to print all the even numbers between 1 and 50 using while, do-while and for loop.The format of the report must be applied towhile, do-while and for loop. And keep the details of all the three loop's report in a single word file
Answered Same DayApr 10, 2021

Answer To: write a C++ program to print all the even numbers between 1 and 50 using while, do-while and for...

Vaishnavi R answered on Apr 10 2021
147 Votes
Module Name: Introduction to Computer Programming
Module Code: EGI00105
Student ID: NU200071
Stud
ent Name: Maryam Alkindi
Programme: EPE
Exercise No: 3
Aim:
Creating a C++ program to print all the even numbers between 1 and 50 using while, do-while and for loop.
Objective:
To write a C++ program to print all the even numbers between 1 and 50 using while, do-while and for loop.
Software Tools:
online c++ complier
Algorithm:
STEP 1: START
STEP 2: INITIALIZE VALUE OF I to 1;
STEP 3: Use for loop to iterate from 1 to 50. Inside this for loop check if current number is even or odd.
STEP 4: If the number is even, I mod 2 (i%2) will be zero. If the number is odd then I mod 2 (i%2) will 1.
STEP 5: Print the values once even number if found inside the if condition.
STEP 6: using while loop : while loop condition will be i<=50. While condition will be true till i is less than equal to...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here