for(i=0;i=printf("Hello");i++);
printf("Hello");
how many times how will be printed?????????

Answer Posted / vignesh1988i

here the basic thing we must understand is that :

printf(); is a function. this printf() always returns the
number of character it processes inside " ".......here it
will return 4 according to me... this will will be assigned
to i and everytime 'i' will be a non zero value always and
also a semicolon is placed after for statement , so compiler
takes that has the next line and PRINTS "HELLO" INFINITELY
since 'i' value is always non zero or always TRUE...

and there is no way for the second printf() to get printed
according to me.........



thank u

Is This Answer Correct ?    18 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Differentiate between static and dynamic modeling.

626


Badboy is defined who has ALL the following properties: Does not have a girlfriend and is not married. He is not more than 23 years old. The middle name should be "Singh" The last name should have more than 4 characters. The character 'a' should appear in the last name at least two times. The name of one of his brothers should be "Ram" Write a method: boolean isBadBoy(boolean hasGirlFriend , boolean isMarried, int age , String middleName , String lastName , String[] brotherName); isHaveGirlFriend is true if the person has a girlfriend isMarried is true if the person is married age is the age of the person middleName is the middle name of the person lastName is the last name of the person brotherName is the array of the names of his brothers

1429


How pointer is different from array?

585


Why we use conio h in c?

591


Are bit fields portable?

681






Write a c program to build a heap method using Pointer to function and pointer to structure ?

4183


Is this program statement valid? INT = 10.50;

690


Describe the difference between = and == symbols in c programming?

782


All technical questions

1514


What is null pointer in c?

600


What is 'bus error'?

651


Differentiate abs() function from fabs() function.

604


if a is an integer variable, a=5/2; will return a value a) 2.5 b) 3 c) 2 d) 0

1456


Why we not create function inside function.

1753


Write a program to reverse a given number in c?

603