I am not getting random value within my described limit. y? is that?
Code:#include<iostream> #include<conio.h> using std::cout; using std::cin; using std::endl; void genNum(void);// prototype int main() { genNum();// function call } void genNum()// definition { int value1, value2, result, sum;// declare alias cout<< value1 << "+" << value2 << "=\t";// prompt the user for input cin>> result;// read input value1=1+rand()%6;// generate random integer 1-10 value2=1+rand()%6;// generate random integer 1-10 sum=value1+value2;// calculate sum if(sum==result) { cout<< "Congratulations! correct"; } else cout<< "No. Please try again"; }