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

+4 votes
asked Jun 19, 2018 by Ashraful Islam Tanzil 2 flags
closed Jun 11 by Admin
Please give me a easy learning script as a example.
closed with the note: Closing question, since it has been answered

36 Answers

0 votes
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);
}
0 votes
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");

}

0 votes
answered Sep 25, 2018 by bala prasanna gopal volisetty (150 points)
#include <stdio.h>

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

    return 0;
}
0 votes
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;

}
0 votes
answered Nov 21, 2018 by srikanth vuyyuru (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);
}
}

0 votes
answered Feb 21 by XTREME TV #P (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";

}

0 votes
answered Feb 22 by shahabuddin (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;

}
0 votes
answered Feb 23 by sri
n1=int(input("enter a number:")

if(n1%2==0):

print("the given num is even")

else:

print("the given num is odd")
0 votes
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]+"") ;
}}
0 votes
answered Feb 23 by Shaik inthiyaz (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");
 }
}
Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and and receive answers from other members of the community.
...