0% found this document useful (0 votes)
7 views3 pages

Palak 13

The document outlines an assignment to create a program that determines if a number is even or odd. It includes an algorithm, a flowchart, and a sample C program implementing the logic. The program prompts the user for input and checks the number's parity using the modulus operator.

Uploaded by

anknownff7
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views3 pages

Palak 13

The document outlines an assignment to create a program that determines if a number is even or odd. It includes an algorithm, a flowchart, and a sample C program implementing the logic. The program prompts the user for input and checks the number's parity using the modulus operator.

Uploaded by

anknownff7
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

ASSIGNMENT-13

QUESTION:
Write a program that finds whether a given number is even or odd.

ALGORITHM:
Step 01) Start
Step 02) Declare Variables : a.
Step 03) Print “Enter Value In a”.
Step 04) Input :a.
Step 05) if (a%2==0)
Step 06) Print “a Is Even”.
Step 07) else
Step 08) Print “a Is Odd”.
Step 09) Stop

CREATED BY : PALAK DAKSH


FLOWCHART:

Start

Declare Variables : a.

Print “Enter Value In a”.

Input :a.

If (a
%2==0)

Print “a Is Even”.

Print “a Is Odd”.

Stop

CREATED BY : PALAK DAKSH


PROGRAM:
#include <stdio.h>
#include <conio.h>
void main()
{
int a;
clrscr();
printf("Enter Value in a = ");
scanf("%d", &a);
if (a%2==0)
{
printf("\n a is even");
}
else
{
printf("\n a is odd");
}
getch();
}

INPUT/OUTPUT:

CREATED BY : PALAK DAKSH

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy