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 is the difference between procedural and declarative language?

771


What is static memory allocation?

716


write a program which the o/p should b in such a way that s triangle if I/p is 3,a Square/rectangle if I/P=4,a pentagon if I/P=5 and so on...forget about the I/P which is less than 3

1741


which of the following is allowed in a "C" arithematic instruction a) [] b) {} c) () d) none of the above

1254


Why doesnt that code work?

685






If I have a char * variable pointing to the name of a function ..

763


How do we open a binary file in Read/Write mode in C?

802


what is different between auto and local static? why should we use local static?

742


Write a program that takes a 5 digit number and calculates 2 power that number and prints it(should not use big integers and exponential functions)

6021


Create a registration form application by taking the details like username, address, phone number, email with password and confirm password (should be same as password).Ensure that the password is of 8 characters with only numbers and alphabets. Take such details for 3 users and display the details. While taking input password must appear as “****”.

2767


How is a structure member accessed?

690


What is the difference between a function and a method in c?

659


When is a null pointer used?

731


What is break in c?

695


hi to every one .. how to view table pool after creating the pooled table? plz help me.. if any knows abt this ..

1566