write an algorithm to add first 15 even positive integers in c
Answers
Answered by
0
int n,sum;
for(int i=0;i<=15;i++)
{
if(i%2==0)
{
sum=sum+i;
}
}
printf("%d",sum)
output:
56
Similar questions
Social Sciences,
6 months ago
English,
6 months ago
Computer Science,
6 months ago
English,
1 year ago
Math,
1 year ago