//Write a program to print sum of all number between 100 to 350 which is divisible by 9 #include<stdio.h> #include<conio.h> void main() { int i,sum=0; clrscr(); for(i=100;i<=350;i=++)//run loop from 100 to 350 { if(i%9==0)//add only if the number is divisible by 9 { sum = sum + i; } } printf("Sum = %d",sum); getch(); }
Comments
Post a Comment