
CBSE Guess > Papers > Important Questions > Class XI > 2010 >Computer Science >Computer Science By Mr. Ravi Kiran
CBSE CLASS XI

Q. 6. Write a program to convert the temperature reading in Fahrenheit to Celsius.
a) #include<iostream.h>
#include<conio.h>
void main( )
{ double c,f;
clrscr( );
cout<<"\nEnter the temperature in Fahrenheit: ";
cin>>f;
c=(5/9.0)*f-32;
cout<<"\nThe equivalent temperature in Celcius: "<<c;
getch( );
}
V. Q.1. What is the difference between ‘=’ and ‘==’? 1
a) = is assignment operator. This operator stores the right side value into left side
variable.= = is relational operator. It will check whether right side and left side operands
are equal or not and returns a true(1) when both are equal, false(0) otherwise.
Q.2. What will be the result of the following two expressions if i=10 initially?
i)cout<<i<<i++<<++i;
a) 121111
ii)cout<<i<<i+1<<++i;
a) 111211
Q.3. What will be the output of the following program?
int main()
{i
nt i=0,x=0;
for(i=1;i<10;i*=2)
{
x++;
cout<<x;
}
cout<<”\n”<<x;
}
a) 1234
Q.4. Rewrite the following program after removing the syntactical error(s) if any.
Underline each correction.
#include<iostream.h>
int main
{ struct movie
{ char movie_name[20];
char movie_type;
int ticket_cost=100;
}movie;
gets(movie_name);
gets(movie_type);
}
a) #include<iostream.h>
#include<stdio.h>
void main( )
{ struct movie
{ char movie_name[20];
char movie_type;
int ticket_cost;
}Movie;
Movie.ticket_cost=100;
gets(Movie.movie_name);
cin>>Movie.movie_type;
}
Q. 5. Convert the following equations to C++ statements.
i) s = 1+1/x+1/x2+1/x3
a) s = 1 + 1/x + 1/(x*x) + 1/(x*x*x);
ii) V = 4/3Πr3
a) V = 4/(3*3.1415*r*r*r);

Paper By Mr. Ravi Kiran
Email Id :mrkdata@yahoo.com
|