Question

2. What is the value of x alter the following code is executed # include<iostream> using namespace std; int main int t-0, c-
4. What is the output of the following code? # include<iostream> using namespace std; int main0 int do x=10, y = 4; x x-2 y y
0 0
Add a comment Improve this question Transcribed image text
Answer #1

main.cpp 2 Online C++ Compiler. Code, Compile, Run and Debug C++ program online. 4 5 Write your code in this editor and pressinput 48 Program finished with exit code 0 Press ENTER to exit console. Activate Windows Go to PC settings to activateV

Here initially χ=3&c=0 for 1st itevation c St . C之 nà iteration c < for gTdteration c4t Scannéd Wi amScannerExecute >Share main.cpp STDIN Ilh Result #include <iostream > 8++ o main .cpp smain 8 12 15 17 18 3 using namespace std; 5 in3)A Here initially a-3 fbr 2nd iteration i-o 3 rd.teration .>о for Cs Scanned with amscannerfor 4Thitevakion .> for ShTtevafion Output 12 IS 1 18C: we a rint tie Value every t cs Scanned with CamScanner toop Yuns,)Execute!! > Share main.cpp STDIN Lli Result #include <iostream» 3 using namespace std; 5 int main() 8++ -o main .cpp Smain 8a) Heve initially lo yr 1st Iteration nd feration for 3Ydlteratioo for 4to Her hon y 4 16 (..toop enda output 8 6 4 2 3 20 CaExecute Share main.cpp STDIN h Result #include <iostream > g -o main .cpp Smain 5 6 8 3 3 using namespace std; 5 int main() 7tỉally for Next iteration ctY cs fbr Next iteration, Cty 3 for Nent iteration Cty 卡3 C., İDop end.) Output 5 6 8 3 .nce we aExecute >Share main.cpp STDIN I.lI Result #include <iostream> main *.cpp main 20 3 using namespace std; 5 int main) int x-s,yere initial人 ., for Aivsk teraion for nent iteration output: 20 CS Scanned with CamScanner

Add a comment
Know the answer?
Add Answer to:
2. What is the value of x alter the following code is executed # include<iostream> using...
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