Question

CHALLENGE ACTIVITY CCAIE2.1: Enter the output of the while loop Start Type the programs output #include <iostream> using namespace std; int main) int g g-0: while (g3) 0123 cout << g: g=g+1; return 0 4 Check Next

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Coding

#include<iostream>//header file for input and output here
using namespace std;
int main()//main start
{
int g;//Declare variable
g=0;//initilize value as zero
/*
while (if condition is true then and then execute this block under)
{
    //do complicated stuff
}
*/

while(g<=3)//here start condition is true because g value which is 0 is less then 3 and execute code for 4 times because we increment it by 1 as value of g is 4 condition will false and get back to the loop
{
cout<<g;//print output display
g=g+1;//incremented
}
return 0;
}

Codesnap:

Global Scope) maino #includeiostream»//header file for input and output here using namespace std; Eint main)//main start int g;//Declare variable g-0;//initilize value as zero while (if condition is true then and then execute this block under) //do complicated stuff while(g<-3)//here start condition is true because g value which is is less then 3 and execute cod cout<<g;//print output display g-g+1;//incremented return 0;

output:

O CWINDOWS system32cmd.exe 123Pres any key to continue . . . _ Final output

if you still have any Problem regarding this question please comment and if you like my code please appreciate me by thumbs up thank you.........

Add a comment
Know the answer?
Add Answer to:
CHALLENGE ACTIVITY CCAIE2.1: Enter the output of the while loop Start Type the program's output #include...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT