11
Chat with our AI personalities
The flow goes something like this for an input number N.
If N < 2, exit NOT PRIME.
If N < 4, exit PRIME.
If (N%2) = 0, or (N%3) = 0, exit NOT PRIME.
If N < 25, exit PRIME.
Set D = 5, E = 2 and M = trunc(sqrt(N))
Repeat:
if (N%D) = 0, exit NOT PRIME.
D = D+E, E = 6-E
If D > M, exit PRIME, else go to Repeat.
You don't write flowcharts, you draw them. Being a text-based forum we cannot show images here, however the related links section contains a link to a flowchart for the creation of the Fibonacci sequence.
Option of drawing a flowchart is not available here. But I can give you the program -
#include<iostream.h>
#include<conio.h>
int main()
{
clrscr();
for(int i=1;i<101;i++)
{
if (i%2!=0)
cout<<i<<endl;
}
return 0;
}
draw a flow chart to find hcf of two given numbers
using OR ().
draw a flowchart to find the biggest number among the 3 numbers
draw a line chart.
in loop when draw a flow chart of table 2