Latest Activity In Study Groups

Join Your Study Groups

VU Past Papers, MCQs and More

We non-commercial site working hard since 2009 to facilitate learning Read More. We can't keep up without your support. Donate.


i solved my assignment

Views: 2812

Attachments:

Replies to This Discussion

Use Next line code i.e

"\n"

someone plz tell me what is wrong in this code?

#include <iostream.h>
main ()
{
int Limit, Values, Sum = 0, Average = 0, Min = 0, Max = 0, MinIndex = 1, MaxIndex = 1;
cout "Enter the Loop Limit:";
cin >> Limit;
for (int i = 1; i <= Limit; i++) // for loop
{
if (i == 1)
{cout "Enter the 1st Value:";
}
else if (i == 2)
{
cout "Enter the 2nd Value:";
}
else if (i == 3)
{
cout "Enter the 3rd Value:";
}
else if (i <= Limit)
{
cout"Enter" i "th Value:";
}
cin >> Values; //taking values from user
Sum += Values;
Average = Sum / Limit;
if (i == 1)
{
Min = Values;
Max = Values;
MinIndex = i;
MaxIndex = i;
}
if (Min > Values)
{
Min = Values;
MinIndex = i;
}
if (Max < Values)
{
Max = Values;
MaxIndex = i;
}
}

RSS

© 2021   Created by + M.Tariq Malik.   Powered by

Promote Us  |  Report an Issue  |  Privacy Policy  |  Terms of Service