how many times does the loop iterated ?
for (i=0;i=10;i+=2)
printf("Hi\n");

Answer Posted / vignesh1988i

this will give an warning message .....

it will print the "Hi" infinite times...... since we used
assignment opeartor in the termination condition of the
looping statement....

when i is initilized to 0 first.. again i=10 is been
initilized to 10... so however i is been incremented by 2 or
by n times.... i=10.. which will be an non zero value.... so
it wont come out of the loop.... infered as infinite running.

Is This Answer Correct ?    6 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Add Two Numbers Without Using the Addition Operator

355


What is difference between stdio h and conio h?

888


The number of bytes of storage occupied by short, int and long are a) 2, 2 and 4 b) 2, 4 and 4 c) 4, 4 and 4 d) none

766


What Is The Difference Between Null And Void Pointer?

644


in programming languages a statement or part of a statement that specifies several different execution sequences a) constructs b) distructs c) executes d) none

604






Define and explain about ! Operator?

615


How can I make sure that my program is the only one accessing a file?

679


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

705


Write a code to determine the total number of stops an elevator would take to serve N number of people.

728


Is there a built-in function in C that can be used for sorting data?

744


What are pointers? What are different types of pointers?

632


What are global variables?

648


Explain what does it mean when a pointer is used in an if statement?

617


In cryptography, you could often break the algorithm if you know what was the original (plain) text that was encoded into the current ciphertext. This is called the plain text attack. In this simple problem, we illustrate the plain text attack on a simple substitution cipher encryption, where you know each letter has been substituted with a different letter from the alphabet but you don’t know what that letter is. You are given the cipherText as the input string to the function getwordSets(). You know that a plain text "AMMUNITION" occurs somewhere in this cipher text. Now, you have to find out which sets of characters corresponds to the encrypted form of the "AMMUNITION". You can assume that the encryption follows simple substitution only. [Hint: You could use the pattern in the "AMMUNITION" like MM occurring twice together to identify this]

1958


What is main () in c language?

598