if Statement in Java

preview_player
Показать описание
Java Programming: if Statement in Java Programming
Topics Discussed:
1. if statement in Java.
2. Examples on if statement in Java.

Music:
Axol x Alex Skrindo - You [NCS Release]

#JavaByNeso #JavaProgramming #ifStatement
Рекомендации по теме
Комментарии
Автор

Sir plz give any minor project stuff so that we can practice all the content you tought us in your Java videos till date.
And after every lecture, give assignment program for practice.
Plz sir🙏

compilerrun
Автор

import java.util.Scanner;
public class Mahesh{
public static void main(String args[]){
Scanner input =new Scanner(System.in);
System.out.print("Enter the Integer number:");
int a=input.nextInt();
if(a%2==0)
{
System.out.println("Integer no. is even ");
}

if(a%2!=0){
System.out.println("Integer no. is odd ");
}
}
}

Akash
Автор

Great explanation, if statement in java is one of the subject most important in the world of programming because depending of this evaluation, your program will be ok or will not be ok, regards from Perú.

Renso
Автор

package ayushi;

import java.util.Scanner;

public class Main {
public static void main(String[] arg) {
   Scanner intput = new Scanner(System.in);
   System.out.println("enter your number:");
   int a =intput.nextInt();
   if (a%2==0)
   System.out.println("even");
   if (a%2!=0)
   System.out.println("odd");
}
}

ayushimukherjee
Автор

Can we have the slides of this lecture sir?

sandamini_madhurasinghe
Автор

import java.util.Scanner;

public class Assignment {
public static void main(String args[]){
Scanner input = new Scanner(System.in);
System.out.print("Enter your no. :");
int i1 = input.nextInt();
if (i1%2==1)
System.out.println("Your no is odd i.e "+i1);
if (i1%2==0)
System.out.println("your no is even i.e. "+i1);

}
}

girishsuraskar
Автор

Name: Urias Kermue
Question: Write a program that reads an integer from the user and tells if it is even or odd.

Solution:

import java.util.Scanner;
public class EvenorOdd {

public static void main(String[] args) {

int x;
Scanner input = new Scanner(System.in);
System.out.print("Enter two integers to determine if even or odd:" );
x=input.nextInt();

if(x%2==0)

{
System.out.println("You have entered an even number:" + x);
}

else
{
System.out.println("You have entered an odd number");
}
input.close();
}

}

urazotech
Автор

Me be watching this video one day before exam be like

hpandeymail
Автор

Give us a good reading material so we can skip the topic by just reading it

hemaysorathia
Автор

dear "a piece" instead then "a peace"

dudududu
Автор

spelling error, its piece instead of peace

kryptedcode
Автор

package com.Karan;

import java.net.SocketOption;
import java.util.Scanner;

class Main{
public static void main(String[] args){

System.out.println("Enter a integer then i will tell you it is a odd or a even integer");
Scanner num= new Scanner(System.in);


==0)?"it is a even":"odd");
}
}

Karansingh-vfei