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


Please Help Members By Posting Answers For Below Questions

What does double pointer mean in c?

571


How can I write functions that take a variable number of arguments?

620


How would you use the functions fseek(), freed(), fwrite() and ftell()?

697


a direct address that identifies a location by means of its displacement from a base address or segment a) absolute address b) relative address c) relative mode d) absolute mode

648


A routine usually part of the operation system that loads a program into memory prior to execution a) linker b) loader c) preprocessor d) compiler

620






Explain what is wrong with this statement? Myname = ?robin?;

990


Explain the use of keyword 'register' with respect to variables.

586


Write a program to show the change in position of a cursor using c

573


cavium networks written test pattern ..

3590


What is array within structure?

578


What's the difference between constant char *p and char * constant p?

651


Why is a semicolon (;) put at the end of every program statement?

620


How can type-insensitive macros be created?

692


Tell us bitwise shift operators?

592


Why does everyone say not to use scanf? What should I use instead?

678