Answer to Question #283794 in C++ for Abdullah

Question #283794

Dry Run the given code:

  1. Take num = 12;

int num; cin>>num;

int t1 = 0;

int t2 = 1;

int newTerm;

for (int i= 1;  i<=num ; i=i+1  ){

    if(i==1){

    cout << t1<< endl;

}

if (i==2){

cout << t2 << endl;

}

newTerm= t1 + t2;

t1= t2;

t2= newTerm;

}




1
Expert's answer
2021-12-30T15:17:56-0500

12

0

1

Program ended with exit code: 0

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 the first!

Leave a comment