C Code:
#include<stdio.h>
void main()
{
int Sum,i,Count;
Sum=Count=0;
i=0;
Loop:
if((i%6==0)&&(i%4!=0))
{
printf("%d \n",i);
Count=Count+1;
Sum=Sum+i;
}
i=i+1;
if(i<=100)
goto Loop;
printf("Sum of Numbers is %d\n",Sum);
printf("Count of Numbers is %d\n",Count);
}
Output:
#include<stdio.h>
void main()
{
int Sum,i,Count;
Sum=Count=0;
i=0;
Loop:
if((i%6==0)&&(i%4!=0))
{
printf("%d \n",i);
Count=Count+1;
Sum=Sum+i;
}
i=i+1;
if(i<=100)
goto Loop;
printf("Sum of Numbers is %d\n",Sum);
printf("Count of Numbers is %d\n",Count);
}
Output:
6
18
30
42
54
66
78
90
Sum of Numbers is 384
Count of Numbers is 8
No comments:
Post a Comment