Determine the code below, tell me exactly how many times is
the operation sum++ performed ?
for ( i = 0; i < 100; i++ )
for ( j = 100; j > 100 - i; j--)
sum++;
Answer Posted / daniel
(99 * 100)/2 = 4950
The sum++ is performed 4950 times.
| Is This Answer Correct ? | 7 Yes | 7 No |
Post New Answer View All Answers
1.int a=10; 2.int b=20; 3. //write here 4.b=30; Write code at line 3 so that when the value of b is changed variable a should automatically change with same value as b. 5.
What are extern variables in c?
What do you mean by c what are the main characteristics of c language?
Why do we use namespace feature?
What is the use of ?: Operator?
Explain what is output redirection?
Explain the difference between malloc() and calloc() function?
What is the sizeof () operator?
What is the size of enum in bytes?
What does %d do in c?
What are the Advantages of using macro
What do you understand by normalization of pointers?
Draw a flowchart to produce a printed list of all the students over the age of 20 in a class .The input records contains the name and age of students. Assume a sentinel value of 99 for the age field of the trailer record
Difference between linking and loading?
What are volatile variables in c?