I want to print both Hello and world.
so what should be the “condition” so that the following code snippet prints HelloWorld
if "condition"
printf ("Hello");
else
printf("World");
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
It doesn’t work that way…
if/elseis one or the other. Not both.If you want to do more than one thing conditionally it has to be something like:
These are concurrent
ifs and the same variable will be evaluated each time you hit one. In this case you’ll getHelloWorldbecause both conditions are true.