34)
int i=50;
for( int sum = 0 ; sum < 1000 ; sum = sum + i ){
i--;
}
35)
since the language was neither given and nor I was able to figure it out, I don't know what statement is used to print strings. replace the boldened statement to the line of code that prints a "$" in the same line.
k=0;
while ( k < 80 ) {
PRINT( "$" );
k++;
}
--------------------------------------
# If you have a query/issue with respect to the answer, please drop a comment. I will surely try to address your query ASAP and resolve the issue
Convert the following while loop into a for loop. int 1 - 50: int sum-07 while...
Q. 07 (2 points) Convert the following while loop to a for loop: int count = 0; while (count<50) cout<<"count iscounts endl count+
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++;
c++ convert do while loop below to a for loop #define MAX VALUE 5 #define START VALUE 5 //START_VALUE always <-MAX VALUE int main() convert do while loop below to a for loop int j - MAX VALUE; do cout <<<<endl; ; while > 0); I
Given an int variable k that has already been declared, use a while loop to print a single line consisting of 97 asterisks. Use no variables other than k. PLEASE ANSWER IN C
2. Rewrite the following loop into a while loop statement: (4 Marks) (CLO2:PLO5:C2) int i, b; cout<<"Please enter the lower bound of the loop:\n"; cin>>b; for (i = 70; b = i; i--) cout << i << endl; CSCS1511/March2019 Page 4 of 6
11) 16 pts. Convert the following for loop to a while loop. (You may want to do the following question first.) int mine [5] = {10, 11, 12); for (int j=1; j < 5; j++) cout <<j<< "" << mine[jl <<" " << end1; 12) 6 pts. What is the output of the previous question? 13) 4 pts. Circle the variables that would NOT cause syntax errors 2-smaTT , entry# break -my-int
How many Iterations will this while loop perform? int ico), j(10); cout << "i = " << i << endl; cout << "j = " << j << endl; while (i > j) { cout << "j-" « j << endl; j += 2; cout << "i = " << i << endl; } cout << "i = << i << endl; cout << "j = " << j << endl; 5 6 C 8 10 Infinite times Does the...
FOR C# PROGRAM Convert the following for loop to a while loop: for (int counter=0; counter<101; counter++) { sum += counter; }
Please answer both questions thank you. Rewrite the following for loop into a while loop: int s S = 0; for (int i = 1; i <= 10; i++) { S += i; int s = 0; int i = while (i <= 10) S = + i; i++; } int s = 0; int i = 1; while (i <= 10) { s = s + i; i++; } int S = 0; int i = 1; while (i...
What is the output of the following C++ code? int count = 1; int num = 25; while (count < 25) { num--; count++; } cout << count « " " « num << endl i 25 1 0 24 1 0 25 0 0 24 0 In this while loop statement, while (counter < 10), where counter is an int variable. Which statement below is an equivalent way to write this while statement? while (10 < counter) while (9...