Write a program to print the multiples of 8 from 1-n and count the total number

//this is a program to print the multiples of 8 from 1-n and count the total number
#include<stdio.h>
#include<conio.h>
void main()
{
int i,n,count=0;

printf("\n\n Enter the last position: ");
scanf("%d",&n);

for(i=1;i<=n;i++)
{
if(i%8==0)
{
printf("\n%d",i);
count++;
}

}
printf("\n\nTotal Count=%d",count);

getch();
}

Previous
Next Post »