Write a program to find whether a given integer is an odd number or even number.Input format:input consists of a single integer.Output format:output consists of a s
zoekar26:
output consists of a what?
Answers
Answered by
0
Answer:
Wrote it in C. Hope it helps
Explanation:
#include <stdio.h>
#include <stdlib.h>
main(){
int x;
printf("Give an integer: ");
scanf("%d", &x);
if(x%2 ==0);
printf("It is an even number");
else
printf("It is an odd number);
system("pause");
}
Answered by
0
Answer:
Take in Java
Explanation:
import java.util.*;
class Ankit
{
public static void main(String args[])
{
Scanner obj = new Scanner(System.in);
System.out.println("Enter the integer");
int n = obj.nextInt();
if(n%2==0)
{
System.out.println("It is even");
}
else
{
System.out.println("IT is an ODD");
}
}
}
Hope it helps....
Similar questions