Ask your own question, for FREE!
Computer Science 11 Online
OpenStudy (anonymous):

An if statement mayor may not have an else clause, but an else clause must be a part of an if statement. is it true or false ?

OpenStudy (anonymous):

#include <iostream> using namespace std; int main() { int list[]={4,5,6,7,8,9}; int i,j; for (i=0;i<6;i++) { for (j=0;j<list[i];j++) { if (j*j==list[i]) { cout<<list[i]<<"-->"<<j<<"F\n"; cout<<list.size(); } } } }

OpenStudy (anonymous):

this code runs just fine

OpenStudy (anonymous):

i mean that statement is write or wrong , it's wrong no?

OpenStudy (anonymous):

it's right, actually, since the if clause automatically generates an else clause (that does nothing) but it won't be same vice versa

OpenStudy (anonymous):

yeah :) thanx

OpenStudy (anonymous):

you're welcome :)

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!