Back To C Loops Index
//program to input two numbers and find sum of numbers between them using while statement #include
#include
void main() { int i,a,b,sum=0; clrscr(); printf("enter value for a"); scanf("%d",&a); printf("enter value for b"); scanf("%d",&b); i=a; while(i<=b) { sum=sum+i; i++; } printf("sum of numbers between a and b is %d",sum); getch(); }