Problem No:1
Write a program that check a number EVEN or ODD.
We can solve the problem in C.
#include<stdio.h>
#include<conio.h>
int main()
{
clrscr();
int number;
printf("Enter a Number:");
scanf("%d",&number);
if (number%2==0)
{
printf("Given Number is EVEN.\n");
}
else
{
printf("Given Number is ODD.\n");
}
getch();
}
Now the same problem we can solve in python.
number=int(input("Enter a Number"))
if number%2==0:
print("Given Number is EVEN")
else:
printf("Given Number is ODD")
The output is same
0 মন্তব্যসমূহ