Search Your Keyword

A One Massage for users

C Program BD say you

Hi, If you are new in our blog and to get support about C program, than you must select your level from right side in this blog.Such as, If you want to learn than you select Entry Level for learning and If you are known the basic of C program than you select Solution Level.


Tuesday, April 2, 2019

Q11. Write a c program that will find the even & odd number total for the number n number.

Algorithm

Step 1: Start
Step 2: Read N
Step 3: Initialization i & start loop
Step 4: if i/2==0;
Step 5: Print even number i
Step 6: Repeat step 4 & 5 until i <=n
Step 7: Initialization j and start loop
Step 8: if j / 2 != 0;
Step 9: Print odd number j
Step 10: Repeat step 8 & 9 until j <=n
Step 11: Stop














Program

#include<stdio.h>
#include<conio.h>
void main()
{
int i, n, j;
clrscr();

print("Enter n =");
scanf("%d", &n);
printf("\n First %d st even numbers:",n);
for(i=0;i<=n;i++)
{
if(i/2==0)
printf("%d",i);
delay(1000);
}
printf("\n First %d st odd numbers:",n);
for(j=0;j<=n;j++)
{
if(j/2!=0)
printf("%d",j);
delay(1000);
}
getch();
}

Flowchart

















Even & odd number total for the number n number finding with c program

c programming for  Even & odd number total for the number n number finding, ing with c program
c programming for  Even & odd number total for the number n number finding, C program for even and odd number, Find even or odd number with c program, c programming for finding even and odd number.

No comments:

Post a Comment