#include<stdio.h>
int main()
{
int i, N, anik = 0, rob = 0, sum = 0;
printf("Enter Any Number : ");
scanf("%d", &N);
for(i=1; i<=N; i+=2)
{
anik = anik + i;
}
for(i=1; i<=N; i+=3)
{
rob = rob + i;
}
sum = anik + rob;
printf("\nSummation is : %d\n", sum);
return 0;
}
int main()
{
int i, N, anik = 0, rob = 0, sum = 0;
printf("Enter Any Number : ");
scanf("%d", &N);
for(i=1; i<=N; i+=2)
{
anik = anik + i;
}
for(i=1; i<=N; i+=3)
{
rob = rob + i;
}
sum = anik + rob;
printf("\nSummation is : %d\n", sum);
return 0;
}
Comments
Post a Comment