Class-XI Com Ter SC Ence M.M.:70 Time:3 Hrs
Class-XI Com Ter SC Ence M.M.:70 Time:3 Hrs
Computer Science
M.M. :70 Time:3 hrs.
Instructions:
Q.4[A] Draw a flowchart that print the smallest of three given no. 2
[B] Rewrite the following program after removing syntactical errors,underline each 2
Correction.
# include<iostream.h>
Void main( )
{
const MAX =
int a, b;
;
cinab;
if(a>b)
MAX = a;
for(x=O;x<MAX; x++)
cout-c-cx;
}
[C] Write a program in c++ to print Fibonacci series:- 3
O,J, I ,2,3,5,8 .
[DJ Write a program in c++ to find out factorial of a given no. 3
[AJ Write a program in c++ to replace every space in a string with hyphen. 2
[BJ Find the total no. of elements and total size of the following array: 2
(i) int student[20] (ii) float A[4][5]
[C] Rewrite the following program after removing syntactical errors,underline each 2
Correction.
#include<iostream.h>
rnairu)
{
int sum[2,4];
for(i=0;i<2;i++)
forU=0;j<=3;i++)
{ cout-c-csurn:
}
[DJ Find out the output for the following program: 4
#include<iostream.h>
mairu)
{
int a[5]= {5, 10, 15,20,25};
int i,j,k=l,m;
i = ++a[l] ;
j= a[2]++;
m= a[i++};
couti<<j<<k<<m;
}
[EJ Write a program in c++ to find row and column sum of a matrix. 3
[FJ Give the proper array declaration for the following :- 2
(i) Declare an integer array A which can hold 30 values.
(ii) declare a two dimensional array called M[N ,4* 5 of integer.
Q.6[AJ What are the 3 steps using a function. 3
[BJ Find the output of the following program: 2
#inc\ude<iosteam.h>
void Execute (int& x.int y=200)
{
int temp = x + y;
x+ = temp;
if(y!=200)
cout< <tern p< <x< <y;
}
main( )
{
int a = 50,b=20;
Executeta.b );
coutab;
}
[C] Write a function in C ++ having 2 parameters x and n of integer type with result
type float to find the sum offollowing series :-
1+ x/2! + x'!'/ 3! + +x'l/n+l ! 3
[DJ Write a program to calculate the sum ofn natural numbers by using function. 3
**********************************************************************