Revision Assignment Class XI (Computer Science
Revision Assignment Class XI (Computer Science
d. In the following program, find the correct possible output(s)from the options:
#include<stdlib.h>
#include<iostream.h>
void main( )
{ randomize( );
char Area[ ][10]={“ NORTH”, “SOUTH”, “EAST”, “WEST”};
int ToGo;
for(int I=0; I<3;I++) {
ToGo=random(2) + 1;
cout<<Area[ToGo]<<”:”; } }
Outputs:
(i) SOUTH : EAST : SOUTH : (ii) NORTH : SOUTH : EAST :
(iii) SOUTH : EAST : WEST : (iv) SOUTH : EAST : EAST :
b. Write a function SumArray() which takes 2 parameters an integer array and its size and
displays sum of even and odd elements in the array.
c. Write a function Sum() which takes 2 parameters a 2-D square matrix and displays sum of the
elements which end with 3
d Write a function which takes a string as parameter and displays no of uppercase, lowercase,
digits and special characters.