#include <stdio.h>
int main(int argc, char **argv)
{
int level = 20;
int age = 30;
if (age > 21 && level > 10)
{
printf ("Congratz you passed!");
else
{
printf ("Nope get out you didnt pass");
}
}
}
Please tell me what is wrong i cant seem to figure it out its very basic c++ just cant figure out what is wrong. Thanks.
You need to add something at the end before you exit
mainthat will prompt the user to input something (i.e,fgetc, etc.), otherwise it will just run and quit unless you’re using a terminal application that is running your program (in that case the terminal app won’t quit, and you’ll see the output of the app).Additionally, you need to return an
intfrommain… on most platforms successful completion of the program requires that you return0.