What is the error on this code? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

What is the error on this code?

int main(void){ int num; printf("enter a number"); scanf("%d",&num); if(num<0); { printf("number is negative"); } else{ printf("number is positive"); } return 0; } https://code.sololearn.com/cHF6sB3C2fu1/?ref=app

4th Jul 2022, 3:56 PM
Nadhil An
Nadhil An - avatar
2 Answers
0
Nadhil An Semicolon is there after if statement which should not be Also dont share others code.
4th Jul 2022, 4:03 PM
A͢J
A͢J - avatar
0
Thanku bro
4th Jul 2022, 4:04 PM
Nadhil An
Nadhil An - avatar