Sunday, April 3, 2011

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

#include<iostream.h>
#include<conio.h>
main()
{
//declaration of varables
int sum, lowerlimit, upperlimit;
//declaraion of vriables
sum = 0;
lowerlimit = 0;
upperlimit = 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();
}
Dear Adnan Ayub.
 
now this program is working, no error.
 
but i m not sir, i also a student.

On Sun, Apr 3, 2011 at 11:55 AM, bc100400164 M. Adnan Ayub <bc100400164@vu.edu.pk> wrote:
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



--
Regards
Ťιğέя
BS(CS) 6th Semester
Virtual University "Lahore"

--
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