Guys Can Anyone tell me How to use "if" | Sololearn: Learn to code for FREE!
Nouvelle formation ! Tous les codeurs devraient apprendre l'IA générative !
Essayez une leçon gratuite
+ 1

Guys Can Anyone tell me How to use "if"

Guys I was trying to use if but an error eqquried everytime. Help Me

15th Nov 2016, 7:37 AM
Momi Xain
Momi Xain - avatar
5 Réponses
+ 1
post your code
15th Nov 2016, 7:55 AM
J.C Vega
J.C Vega - avatar
0
hi momi, so tell us in wich language you tried the "if-clause"... that is not that important, but we will give you the exact example.
15th Nov 2016, 7:57 AM
jmey
0
Csharp
15th Nov 2016, 7:58 AM
Momi Xain
Momi Xain - avatar
0
int x = 8; int y = 3; if (x > y) //if true code in brackets will print { Console.WriteLine("x is greater than y"); //this } //if false it will skip that code a do nothing.
15th Nov 2016, 8:08 AM
J.C Vega
J.C Vega - avatar
0
int x = 0 int y = 1; //simple if statement if(x < 1){ System.out.println("hello"); }else{ //else statement is used when the 'if' statement is false System.out.println("bye"); } //double if statement if(x < 2 || y y < 2){ // this || is used to represent 'or' // this code is specifying that if x or y is less than 2 } if(x < 2 && y < 2){ // this '&&' used used to represent 'and' // this code States that both statement need to be true }
15th Nov 2016, 8:39 AM
Abdelaziz Abubaker
Abdelaziz Abubaker - avatar