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
How can you avoid including a header more than once?
A collection of data with a given structure for excepting storing and providing on demand data for multiple users a) linked list b) datastructer c) database d) preprocessor
Is array a primitive data type in c?
How reliable are floating-point comparisons?
What is difference between class and structure?
Implement bit Array in C.
Why is c used in embedded systems?
What are the applications of c language?
What does do in c?
What is pragma in c?
Define macros.
Multiply an Integer Number by 2 Without Using Multiplication Operator
How can I find out if there are characters available for reading?
Why is sprintf unsafe?
What are dangling pointers? How are dangling pointers different from memory leaks?