Hello, OnlineGDB Q&A section lets you put your programming query to fellow community users. Asking a solution for whole assignment is strictly not allowed. You may ask for help where you are stuck. Try to add as much information as possible so that fellow users can know about your problem statement easily.

how do I connect the if and else it keeps telling me it isnt connected

+2 votes
asked Jun 20, 2022 by Hwill (140 points)

3 Answers

0 votes
answered Jun 21, 2022 by Peter Minarik (84,720 points)
Can you share your code that does not work? What programming language are you using? What is the exact error message? (Perhaps you have extra semicolons that shouldn't be there.)

Without these it's pretty hard to find out what's wrong.
+1 vote
answered Jul 6, 2022 by AADI JAIN (350 points)
check for extra brackets,semicolons if any plz share the code to identify the correct error also if you use if and else see that there should be no code between the ending of if and starting of else

example-

if()  

 {//code for if}

//no code here

else

{//code for else }
+1 vote
answered Sep 1, 2022 by Shruti Gossain (200 points)
if(condition)

{

statement;

}

else if(condition)

{

statement;

}

else

{

statement;

}
commented Sep 6, 2022 by Zaid Pathan (100 points)
There shouldn't be a space between else and if in the 5th line
Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and and receive answers from other members of the community.
...