1.f) In the following program, if the value of N given by the user is 20, what maximum and minimum values the program could possibly display?
#include <iostream.h>
#include <stdlib.h>
void main()
{ int N,Guessnum;
randomize();
cin>>N;
Guessnum=random(N-10)+10;
cout<<Guessnum<<endl;
}
2
Answer:Maximum Value:19 Minimum , Value:10
(1 Mark for writing correct minimum value)(1 Mark for writing correct maximum value)
Header files – Important Functions.
From Old Papers 2009 Outside Delhi:
2008 Delhi & OD:
2007 Delhi & OD:
2006 Delhi:
2006 Outside Delhi
2005 Delhi:
2005 OD:
2004 :
|
CBSE Computer Science Solved Revision Tour By Mr. Ravi Kiran ( [email protected] )