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

What are the functions to open and close file in c language?

818


How can I find out the size of a file, prior to reading it in?

743


a value that does not change during program execution a) variabe b) argument c) parameter d) none

811


Tell us something about keyword 'auto'.

752


What is getch c?

951






How will you write a code for accessing the length of an array without assigning it to another variable?

699


1) There is a singing competition for children going to be conducted at a local club. Parents have been asked to arrive at least an hour before and register their children’s names with the Program Manager. Whenever a participant registers, the Program Manager has to position the name of the person in a list in alphabet order. Write a program to help the Program Manager do this by placing the name in the right place each time the Program Manger enters a name. 2) the Event Manager has to send participants to the stage to perform in the order in which they registered. Write a program that will help the Event Manager know who to call to the stage to perform. The Logic should be in Data Structures

2849


What are types of functions?

663


Once I have used freopen, how can I get the original stdout (or stdin) back?

723


What is a pointer value and address in c?

728


GIVEN A FLOATING POINT NUMBER HOW IS IT ACTUALLY STORED IN MEMORY ? CAN ANYONE EXPLAIN?? THE 32 BIT REPRESENTATION OF A FLOATING POINT NUMBER ALLOTS: 1 BIT-SIGN 8 BITS-EXPONENT 23 BITS-MANTISSA

1550


What is the use of the function in c?

695


How to Throw some light on the splay trees?

704


What is pragma in c?

725


how many key words availabel in c a) 28 b) 31 c) 32

715