Computer Science, asked by pawan2054, 1 year ago

draw a flow chart and write an algorithm for a program that multiple first n odd number starting from 1. the value of n be given as input to the program.( you must use looping).

Answers

Answered by Anonymous
4

Hola! Friend


_____________________________
#include

int main()
{
int i, n;


printf("Print odd numbers till: ");
scanf("%d", &n);

printf("All odd numbers from 1 to %d are: \n", n);


for(i=1; i<=n; i++)
{

if(i%2!=0)
{
printf("%d\n", i);
}
}

return 0;
}

Hope it's help u
Similar questions