64 491
Assignments Done
99,1%
Successfully Done
In September 2018

Answer to Question #26751 in C++ for red rose

Question #26751
Write the following programs using a while loop:
a) Display the multiples of 3 backward from 33 to 3 inclusive
b) Display the uppercase letters of the alphabet from A to Z

Expert's answer
a)
#include <iostream>

using namespace std;

int main()
{
int n = 33;// define variable n and set it to 33
while(n>= 3) // while n more then 3 or equal
{
cout<< n << " "; // print n
n-= 3; // subtract 3 from n
}
}

b)
#include<iostream>

usingnamespace std;

intmain()
{
charc = 'A'; // define variable c and set it to 'A'
while(c<= 'Z') // while c less or equal to 'Z'
{
cout<< c << " "; // print c
c++;// increment c
}
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be first!

Leave a comment

Ask Your question

Submit
Privacy policy Terms and Conditions