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.


Thursday, December 12, 2019

দুটি সংখ্যার গ. সা. গু নির্নেয়ের জন্য অ্যালগরিদম, ফ্লোচার্ট ও প্রোগ্রাাম.

Flowchart


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();
}

No comments:

Post a Comment