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 / santosh

when i=0
j=100 and 100>100-1(false) come out of the loop and the sum
is executed 0 times

Is This Answer Correct ?    2 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Which is better pointer or array?

592


What does c value mean?

616


What is c mainly used for?

592


What is include directive in c?

638


What are data types in c language?

578






Why is c not oop?

533


How can I run c program?

677


Do you have any idea how to compare array with pointer in c?

597


Write a program to compute the similarity between two strings - The program should get the two strings as input - Then it will output one single number which is the percentage of similarity between the two strings

2243


Is this program statement valid? INT = 10.50;

685


In this assignment you are asked to write a multithreaded program to find the duplicates in an array of 10 million integers. The integers are between -5000,000 to 5000,000 and are generated randomly. Use 10 threads, each thread works on 1000,000 integers. Compare the time needed to accomplish the task with single thread of execution program. Do not include the time to fill the array with integers in the execution time.

2677


What is ## preprocessor operator in c?

607


What is the difference between the = symbol and == symbol?

617


Give me the code of in-order recursive and non-recursive.

878


Tell me can the size of an array be declared at runtime?

592