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

0 times bcoz everytime it enters second loop condition is
not satisfied ,thus comes out of loop.

Is This Answer Correct ?    14 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is difference between Structure and Unions?

742


Study the following C program :call_me (myvar)int myvar;{ myvar +- 5; }main(){int myvar;myvar = 3;call_me(myvar);printf("%d ",myvar);What will be printed a) 3 b) 5 c) 8 d) symbol

764


Why & is used in scanf in c?

726


in case any function return float value we must declare a) the function must be declared as 'float' in main() as well b) the function automatically returned float values c) function before declared 'float' keyword d) all the above

694


What are the header files used in c language?

669






Explain how do you search data in a data file using random access method?

779


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

743


What is typedef example?

724


What are the different file extensions involved when programming in C?

872


What is string function c?

657


How do I get a null pointer in my programs?

743


Given two strings S1 and S2. Delete from S2 all those characters which occur in S1 also and finally create a clean S2 with the relevant characters deleted.

950


Can you please explain the difference between syntax vs logical error?

779


How do you print only part of a string?

695


What is the process to generate random numbers in c programming language?

722