11th Computer Science Half yearly exam important program question PDF 2022-2023
11th Computer Science Half yearly exam important program question
Here we give example Half yearly exam important program question.
- Write the C++ program to display the following output
0 1 1 2 3 5 ….. n terms
- Initially j is 20 and p is 4, then what will be the value of p=p*++j;?
- Write a while loop that displays numbers 5, 10, 15, …..50.
- What are the values of variables m and n after the assignments in line (1) and line (3)?m, n : = 4, 10- – m, n = ?, ?m, n : = m + 5, n-2- – m, n =?, ?
- Read the following C++ snippet and answer the question given below
class student
{
int m, n;
float calc();
}x1, x2;
- i) Identify the members of the class.
- ii) What is size of the objects x1, x2 in memory.
- After the assignment what values will be stored in the variables m, n?
1) m, n : =10, 5
2) m, n : = m+3, n-2
3) m, n : = ?, ?
- How many time the loop is iterated?
m:=10
while(m<5)
m:=m+1
- int age[] = {6, 80, 75, 21, 10}; How many elements are there in this array?
- int x=10;
int main()
{
int x = 100;
cout<<::x;
}
The output for the above snippet:
- What is the size of the objects s1, s2?
class sum
{
int n1,n2;
public:
void add(){int n3=10;n1=n2=10;}
} s1,s2;
21. State the reason for the invalidity of the following code fragment
(i)
class count
{
int first;
int second;
public:
int first;
};
(ii)
class item
{
int prd;
};
item int prdno;
- Write a C++ program to add two distances using the following structure definition
struct Distance{
int feet;
float inch;
}d1 , d2, sum;
The pdf is given below. Kindly download and make it useful.
[pdf-embedder url=”https://csknowledgeopener.com/wp-content/uploads/2022/12/XI-CS-CA-Half-Yearly-Exam-Important-Program-Question-2022-2023.pdf” title=”XI – CS & CA Half Yearly Exam Important Program Question 2022-2023″]