# How to make a program to find out odd or even numbers?

asked Jun 19, 2018 2 flags
closed Jun 11
Please give me a easy learning script as a example.
closed with the note: Closing question, since it has been answered

answered Jul 14, 2018 by anonymous
#include<stdio.h>
main()
{
int n;
printf("\nEnter the number:");
scandal("%d",&n);
while(n!=0)
{
if(n%2==0)
printf("\nEntered %d is even number",n);
}
printf("\nEntered %d is odd number",n);
}
answered Sep 4, 2018 by TechnicalSeek

Even odd program

#include<stdio.h>

void main()

{

int number;

printf("Enter a Number \n");

scanf("%d", &number);

if(number % 2 == 0)

{

printf("The number %d is Even", number);

}

else

{

printf("The number %d is Odd",number);

}

printf("\n");

}

answered Sep 25, 2018 by (150 points)
#include <stdio.h>

int main()
{
int n;
for(n=1; n<=100; n=n+1) {
printf("%d ", n); // Display 'n'
}

return 0;
}
answered Sep 26, 2018 by NAMAN MAHESHWARI
#include"stdio.h"

int main(void)

{

int n;

printf("enter the velueof n ");

scanf("%d",&n);

if(n%2==0)

{

printf("number is even");

}

else

{

printf("number is odd");

}

return 0;

}
answered Nov 21, 2018 by (210 points)

#include <stdio.h>

int main()
{
int a,b;

printf ("Enter the number");
scanf ("%d",&a);

if (a%2==0)
{
printf ("The Number %d is Even",a);
}
else
{
printf ("The Number %d is odd",a);
}
}

answered Feb 21 by (140 points)

#include<iostream.h>

main()

{

int n;

cout<<"enter a number";

cin>>n;

if(n%2==0)

cout<<"it is even";

else

cout<<"it is odd";

}

answered Feb 22 by (150 points)
#include<stdio.h>

int main()

{

int  i  ;

printf("enter any number  :  ");

scanf("%d",&i);

if ( i % 2==0)

printf("the entered number is even");

else

printf("the entered number is odd");

return 0;

}
n1=int(input("enter a number:")

if(n1%2==0):

print("the given num is even")

else:

print("the given num is odd")
answered Feb 23 by Swastika 1 flag
class SortedArray
{
static void main bubbleSorting()
{
int I, j, temp;
int arr[]={4,45,65,34,12,3,9,17,8}
for(i=arr.length-1;i>0;i--)
{
if(arr[j]>arr[j+1])
{
temp=arr[j+I];
}}}for(I= 0;i<arr.length;i++)
System.out.println(arr[i]+"") ;
}}
answered Feb 23 by (140 points)
#include <stdio.h>

int main()
{
int n;
printf("enter a number\n");
scanf("%d",&n);
if(n%2==0){
printf("it is a even number\n");
}
else
{
printf("it is  a odd number\n");
}
}