Вы находитесь на странице: 1из 5

REVISION PAPER

I. Answer the following questions

a. Explain the working of ALU.


b. Briefly explain DVD-ROM.
c. Mention the difference between compiler and interpretor..
d. Briefly explain Disk Defragmentor utility.
e. Briefly explain the classifications of purpose wise digital computers.

II. Do the following conversions.

a. 687.0312510  hexadecimal
b. 24.68  decimal
c. 101101012 decimal
d. 10110111 . 11112octal
e. FACE . ACE  binary

III. Identify the syntax errors in the following programs. Rewrite the corrected programs and
underline the corrections.
a.
main( )
{int n1=5 , n2=0;
n1/=n2;
n+3 = n1 != n2 ? n1;
}
b.
void main( )
{ long float f(4.5); int i=1.25;
if(f)
cout<<"True"<<endl;
f = i + 10.5;
else if
cout<<"False";
f = 20.5 - i; }
c.
void main( )
{ char chr = 'B' , ch = 'W';
switch(chr);
{case 'B' : case 66: cout<<"Black"<<endl; break;
case ch : cout<<"White"<<Endl; break;
default case : cout<<"Invalid"<<endl;} }
IV. Find the output of the following codes. Assume that all header files are included.
a.
void main ( )
{float a = 0.5, b = 0.9 ;
if(a&&b>0.9)
cout<<”IF PART”;
cout<<”ELSE PART”; }
b.
void main( )
{int a=29,b=2,c;
c = (float) (a/b);
cout<<c; }

c.
void main( )
{ int x=1;

cout<<(x=x+2)<<endl;

cout<<!x<<endl;
}

d.
void main()
{ int a=1,b=2,c=3,d=4.75,x;

x = ++a + b++ * ++c%d++;

cout<<a<<' '<<b<<' '<<c<<' '<<x;


}
e.
void main()
{
int i=1,j=1;

for(; ;)
{ if(i>3) break;

else j+=i;
cout<<j<<endl;

i+=j;
}
}
f.
void main ( )

{ int x = 10,y,z;

z = y = x;

y - = x- -;

x - = - -x - x;

cout<<y<<' '<<x; }

VI. Answer the following questions.

a. Explain the following with suitable examples - i) Break ii) Continue.

b. Give any 2 disadvantages of a switch case.

c. What do you mean by an entry controlled and an exit controlled loop. Give 1 difference.

d. Briefly explain one logical operator with an example.

e. Explain implicit and explicit type conversions with an example for each.

VII. Do the following


a. WAP to accept a string and display each word and its length on different lines. b.
b. Write a function DEL( )that would accept a numeric array and its size as arguments. The
function deletes only the first occurrence of the given number. Write main( ) to
incorporate the function.
c. WAP to accept a string of size 50. Display the number of occurrences of each
alphabet[a-z , A-Z] in the string. If the alphabet is not present there should be no display
for it. Other symbols are not counted.
d. WAP to accept 2 integers and pass them to a function AUTOMORPHIC( ) which checks
if the pair is an automorphic pair or not. If they are the function returns 1 otherwise the
function returns 0. Main( ) has to display appropriate messages.

Note : A pair of numbers are automorphic if the sum of factors of one number equals to
the other numbers and vice versa.
Example 220 and 284 . Sum of all the factors of 220 equals to 284 and vice versa.

e. WAP to accept numbers into an integer array of size 6 and call a function ALTSWAP( ) .
The function swaps the alternate locations only if the number is a factor of 10.
Example : if the original array is
90 1 5 20 7 3
Then the swapped array is
1 90 5 7 20 3

f. Write a function FINDMAX( ) that would accept a 2D integer array and its row and
column size as arguments. The function displays the biggest number of each row.
Incorporate a main( ) function to accept the array and pass it to the function.

g. WAP to accept a string and count the number of words which are palindromes in it.
Incorporate a function PALIN( ) that would accept one word at a time and checks if it is
a palindrome or not. The function returns 1 if true else it returns 0.Counting is done in
main( ).

h. WAP to do the following:


 Define a structure PRINTER [ pcode (int) , pname( string) , pprice(float)]
 Create a strucute array to hold 5 records
 Display the record of the printer whose price is the least.
i. WAP to find the sum of the following series.
1!/y2 + 4!/y4 + 7!/y6 +10!/y8… n terms. y and n are accepted from the user.

j. WAP to calculate n! / (r ! * (n - r)! ) . Accept n and r from user.

k. WAP to print the following


P
P Q
P Q R
P Q R S
P Q R S T
g. Create an array of structure BOOK having bookno(integer), bookname(string of 20
characters) , price(float). Enter 5 records and display all the book details whose price is more
than 1000.

Вам также может понравиться