Back To C++ Loops Index
//program to input two numbers a and b and find sum of numbers between them using for statement #include
#include
void main() { int a,b; int i; int sum=0; clrscr(); cout<<"enter value for a"; cin>>a; cout<<"enter value for b"; cin>>b; for(i=a;i<=b;i++) { sum=sum+i; } cout<<"sum of numbers from a to b is "<