Answers:::
1)While (count<10) is equivalent to while(count<=9)
2) for loop is used for repetition.. if else is used for select
pertucular operation based on condition.
3) after execution of above code.. count ends with 25 and num ends
with 1.
What is the output of the following C++ code? int count = 1; int num =...
What is the output? (3 pts) int num = 5; int* ptr = # cout << ptr << endl; cout << &ptr << endl; cout << *ptr << endl;
using C++ 1. Convert the following while loop into a for loop: int count = 0; while (count < 10) x = count + sin(x); y = count + cos(y); count++;
A. What is the output of the following C++ code fragment? (all variables are of type int) int count-1; int y-100; while (count 3) y=y-1 ; count+t cout << y << endl; cout<< count <<endl What is the value of x after control leaves the following while loop? (all variables are of type int) B. int x0 while (x < 20) sum- sum+x cout << sum<< endl;
What does the following code output? int x = 7, y = 10; X -= 30; y *= 5; X += 32; y /= 4; cout << "y = " « y << " and x = " << x << "; " << endl; X -= 10; y /= 5; cout << "x = " << x < " and y = " << y « ";" << endl;
trace e following C++ program and provide the correct output: int x = 20, count=0; do { cout << x; x = 4* (x + 5)/5; count++; }while (count < 2);
Thie What is the output of the following program segment? int count 1; do System.out.print(count (count-) + while(count++ <= 5);
Q. 07 (2 points) Convert the following while loop to a for loop: int count = 0; while (count<50) cout<<"count iscounts endl count+
All in C++ Create a function NumEven( std: forward_list-int> SList) that computes and returns the number of even values in a singly linked list SList of type std: forward_list-int> If there is no even value or the list is empty, return 0. Select the appropriate C++ statement for each of the below to implement the function. unsigned NumEven (std:: forward_list<int> Slist) { Select] Select ] Select ] } [ Select] for (int i; i < num; i++) { if (n...
What will the output be in the following? int a, b, c; a-b-0; c 5; ific< 1011 (a = = 0 &&b != 0)) 3. cout<<True"; else cout<<"False", What will the output be in the following? a. int icount; 4. do count = 0; cout<<"The count is "<cicount<<endl; while(icount<10); int count = 0; do b. cout<<"The count is “<<count<<endl; while++icount<10); c. for(int n 5; n>0; n-) cout<<n;
51. What is the output of the following code snippet? int number = 0; int ptr_num -&number ptr_num 60; number-80 cout < "ptr num << endl b, 60 c. 80 d. the address of number Answer 52. What is the output of the following code snippet? double num-0.0; double* ptr = # num = 15.0; ptr ptr 15.0 cout << num <<"ptr <<endl; a. 15 15 b. 15 30 С. 30 15 d. 30 30 Answer: 53. What is the...