13908revision For First Semester Exam (Xi)
13908revision For First Semester Exam (Xi)
com/
www.cbseguess.com
Other Educational Portals
www.icseguess.com | www.ignouguess.com | www.aipmtguess.com | www.aieeeguess.com |
www.niosguess.com | www.iitguess.com
http://www.cbseguess.com/
for(int i=1;i<3;i++)
for(int j=1;j<3;j++)
{
a[i] = 3 * i +j;
cout << a[i] << “\n”;
}
if (i%2 = = 1)
x[i] = tolower(x[i]);
else
x[i]=’*’;
i++;
} cout<<x;
}
7. The following program is used to find the reverse of a number. Some codes are
Missing in it. Supply only the missing codes
void main()
{
int n, rem, rev =0;
cin>>n;
while(_________)
{
rem =_________;
rev = _________;
n = _________;
}
cout<< rev;
}
9. Write one or more statements to carry out each of the following operations
a) Print the elements of the third column of the array A[5][6]
b) Calculate the elements of the numeric table B which has 6 rows and 8 columns. Each element
of B is determined by the formula Bij= 3 * i + j;
c) Declare an array of 6 integers and initialize it to the first 10 even numbers.
void main( )
{
int a[6]={1,2,3,4,5,8};
int i, j,k=1,m;
i= ++a[1];
j=a[2]++;
m=a[i++];
cout<<i<<j<<m;
}
15. Give the contents of the array A[5][2], if the entered data is 12,10,19,20,8,5,3,7,1,6
16. Write the statements for the following:
a) Assign the value 10 to the third element of the array x[7].
b) Assign the value 7 to the element stored at location 4 th row and 2nd column of A[6][5].
17. Write one or more statements to carry out each of the following operations (2)
a) Print the elements of the third column of the array A[5][6]
b) Calculate the elements of the numeric table B which has 6 rows and 8 columns. Each element
of B is determined by the formula Bij= 3 * i + j;
void main( )
{
int a,b=0;
int c[10]={10,11,12,13,14,15,16,17,18,19};
for(a=0;a<10;++a)
if((a%2= =1)
b+=c[a];
cout<<b;
}
19. Write equivalent c++ expressions for the following.
i) cos2x + e2y ii) (1-y3)0.5
6
sin z - | 1+a | (1+x4)0.25
for (j=1;j<=10;++j)
for(k=10;k>=1;--k)
cout<<j*k;
cout<<”computer science”;
22. Rewrite the following program after removing all syntax error(s), if any
#include(iostream.h)
void main( )
{ int p[ ] = {90,10,24,15}; q, number = 4;
q=9;
for[int i=number-1;i>=0;i--]
switch(i)
{ case 0:
case 3: cout<<p[i]*q<<endl;break;
case 1:
case 2:
}
}
cout<<a<<”\n”<<b<<”\n”<< --b<<endl;
}
b) #include<iostream.h>
void main( )
{
int i=0,ua=0,ub=0,uc=0,fail=0;
while(i<=5)
{ switch(i++)
{
case 1: ++ua;
case 2: ++ub;
case 3:
case 4: ++uc;
default : ++fail;
}
}
cout<<”ua =”<<ua<<”,ub =”<<ub<<”,uc=”<<uc<<”,fail=”<<fail;
}
c) #include<iostream.h> 1
void main( )
{
int a=2,b=5,c=3,m;
m=(a>b) ? c : (( b>c) ? b : c ) ;
cout<<m;
}
}
25. What will be the output of the following?
a) #include<iostream.h>
void main( )
{ char ch[9] = {‘C’, ‘o’, ‘m’, ‘p’, ‘u’, ‘t’, ‘e’, ’r’, ‘\0’ };
cout<<ch[4] << ch[2] <<ch[6];
}
b) #include<iostream.h>
void main()
{ int U=10, V=20;
for(int i=1; i<=2; i++)
www.cbseguess.com
Other Educational Portals
www.icseguess.com | www.ignouguess.com | www.aipmtguess.com | www.aieeeguess.com |
www.niosguess.com | www.iitguess.com
http://www.cbseguess.com/
{
cout<<”[1]=”<<U++<<”&”<<V-5<<endl;
cout<<”[2]=”<<++V<<”&”<<U+2<<endl;
}
}
c) #include<iostream.h>
void main( )
{ int x=5, y=3, z=8;
int m= x>y;
int n=z>y;
cout<<”n=”<<n<<endl;
cout<<”m=”<<m<<endl;
cout<<”x=”<<x++<<”y=”<<++y<<”z=”<<z<<endl;
while(m)
{
cout<<m<<“ ”<<n<<endl;
if(m==10)
break;
else
m- -;
}
}
d) #include<iostream.h>
#include<ctype.h>
void main( )
{ char Line[ ] = “StRing!!Out@put!”;
for(int i=0; Line[i]!=’\0’; i++)
{
if( ! isalpha(Line[i]))
Line[i] = ‘ # ’;
else if( islower(Line[i]))
Line[i] =Line[i+1];
Else
Line[i]= Line[i]+1;
}
cout<< Line;
}
26.
a) Identify syntax errors, if any, in the following code fragment
i)
int DIV 5;
void main()
{
Num = 15;
for( count=1; count<=5; count++)
if(Num % Div = 0)
cout<<Num / Div;
cout<<endl;
else
www.cbseguess.com
Other Educational Portals
www.icseguess.com | www.ignouguess.com | www.aipmtguess.com | www.aieeeguess.com |
www.niosguess.com | www.iitguess.com
http://www.cbseguess.com/
29. Give the contents of the array A[4][2], if the entered data is 12, 17, 6, 11, 22, 19, 21, 9.
32. Write the different header files required to execute the following program
void main()
{
char t[20];
clrscr();
cout<< “Enter text”;
gets(t);
if(islower(t[0]);
t[0]=toupper(t[0]);
www.cbseguess.com
Other Educational Portals
www.icseguess.com | www.ignouguess.com | www.aipmtguess.com | www.aieeeguess.com |
www.niosguess.com | www.iitguess.com
http://www.cbseguess.com/
puts(t);
}
{
int I,j,sum=0;
i=1;
while(i++<=10)
{ j=1;
while(j++<=10)
sum += 1;
}
cout<<sum;
www.cbseguess.com
Other Educational Portals
www.icseguess.com | www.ignouguess.com | www.aipmtguess.com | www.aieeeguess.com |
www.niosguess.com | www.iitguess.com
http://www.cbseguess.com/
41. What will be the size of following constants : ‘\a’ , “A\a” , “Reema\’s” , “/ \ “.
www.cbseguess.com
Other Educational Portals
www.icseguess.com | www.ignouguess.com | www.aipmtguess.com | www.aieeeguess.com |
www.niosguess.com | www.iitguess.com
http://www.cbseguess.com/
a. Operating system
b. Hardware
c. Software
d. System software
e. Application software
f. Utilities
g. Compiler
h. Interpreter
i. Source program
j. Object program
k. Booting (cold booting , warm booting )
l. Multiprogramming
m. Multiprocessing
n. Time sharing
By,
Mrs. Deepa Kaliyamoorthy
Sunrise English Private School,
Abudhabi
00971505221828
[email protected]
www.cbseguess.com
Other Educational Portals
www.icseguess.com | www.ignouguess.com | www.aipmtguess.com | www.aieeeguess.com |
www.niosguess.com | www.iitguess.com