+ 5
I am a beginner and I came up with this code.. I want you guys to reveal all the mistakes I did. Comment as much as you can!!?
7 Antworten
+ 6
//Here's a shorter and neater version of your code
//If there is a single statement inside a condition/loop you can ignore the the curly braces
#include <iostream>
using namespace std;
int main()
{
int a,c;
cout<<"How old are you?\n";
cin>>a;
if(a>15 && a<60)
{
cout<<"Enter your exam marks\n";
cin>>c;
}
else
cout<<"you are not part of the age group"<<endl;
if(c>=80 && c<=100)
cout<< "you passed, and you are going on tour\n";
else
cout<<"you failed, and you\'re not going on tour\n";
return 0;
}
+ 8
It's fine.. great work.
Try harder problems and challenges. Solve the assignments so you can master the skills. Best of luck😊😊
+ 4
thanksAaron Stone
+ 4
amazing.
+ 1
Cool code. Needs work though
0
da
0
Cool code