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
Which is better pointer or array?
What does c value mean?
What is c mainly used for?
What is include directive in c?
What are data types in c language?
Why is c not oop?
How can I run c program?
Do you have any idea how to compare array with pointer in c?
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
Is this program statement valid? INT = 10.50;
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.
What is ## preprocessor operator in c?
What is the difference between the = symbol and == symbol?
Give me the code of in-order recursive and non-recursive.
Tell me can the size of an array be declared at runtime?