#include<stdio.h>
main()
{
int i,con=0,sum=0,num;
printf("Enter a number=");
scanf("%d",&num);
for(i=100;i<=200;i++)
{
if(i%num==0)
{
con++;
sum=sum+i;
}
}
printf("\nNumber of integers=%d\n",con);
printf("\nSum of integers=%d\n",sum);
}
main()
{
int i,con=0,sum=0,num;
printf("Enter a number=");
scanf("%d",&num);
for(i=100;i<=200;i++)
{
if(i%num==0)
{
con++;
sum=sum+i;
}
}
printf("\nNumber of integers=%d\n",con);
printf("\nSum of integers=%d\n",sum);
}
No comments:
Post a Comment