Saturday, April 2, 2011

::::|| VU ||:::: Problem with program execution

#include<iostream.h>
#include<conio.h>
main()
{
//declaration of varables
int sum, lowerlimit, upperlimit;
//declaraion of vriables
sum = 0;

//for taking the both lower and upper limits from user we prompts the user

cout<<"please enter lower Limit Value that you wanna sum: ";
cin>>lowerlimit;
cout<<"please enter the Upper Limit for which you wanna sum: ":
cin>>upperlimit;

//using while loop for finding the sum between upper and lower limits

while(lowerlimit <= upperlimit)
{
//using the if loop for condition only the upper limit is greater

if(upperlimit > lowerlimit)
sum = sum + lowerlimit;
lowerlimit = lowerlimit + 1;

//else condition for getting correct digit
else()
cout<<"Enter the correct Digit or Greater than Lower Limit by runnig program again";
}
cout<<"The sum of number from "<<lowerlimit<<" and "<<upperlimit<<" is "<<sum;

getch();
}
Respected Sir Aslam'o Alekum,

sir,
 me have try to write the one example but the program didn't complie that, kindly help me on this..

Thank you soo much

--
For study materials, past papers and assignments,
Join VU School at www.VusCool.com
and www.VUGuys.com
CoooL Virtual University Students Google Group.
To post to this group, send email to coool_vu_students@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/coool_vu_students?hl=en

No comments:

Post a Comment