#include<iostream.h>
#include<cstdlib>
void main()
{
int n,a,b,r,t,sum,s,e=0;
unsigned int l=1,k=0;
cout<<"welcome !\n\n";
cout<<"this is quiz in the sum\n\n";
cout<<"enter the number of qustions you need : ";
cin>>n;
cout<<endl;
cout<<"you need: ("<<n<<") qustion!\n"<<endl;
cout<<"you must select the range of number that you need \n"<<endl;
cout<<"enter the start range : ";
cin>>a;
cout<<"\nenter the end range : ";
cin>>b;
cout<<"\nyour number bettwen ("<<a<<") and ("<<b<<") "<<endl;
for(int m=1;m<=n;m++)
{
srand(l);
r=rand()%b+a;
srand(k);
t=rand()%b+a;
sum=r+t;
cout<<"\n\tQ"<<m<<") "<<r<<" + "<<t<<" = ";
cin>>s;
if(sum==s)
{
cout<<endl;
cout<<"\n\tExcellent\a\a"<<endl;
}
else
{
cout<<endl;
cout<<"\n\terror tray again\a\a"<<endl;
e++;
}
l++;
k++;
if(e==3)
break;
else
continue;
}
if(e==3)
cout<<"\n\t\tyou must study hard\n\n\a\a\a\a";
else
cout<<"\n\t\tyou are very good\n\n\a\a\a\a";
}
