Psuc
Psuc
Psuc
1. A) What is an operating system? Give an example. B) Explain the basic built-in data types in C++? Give an example for each.
(2 marks) (4 marks)
C) Distinguish between Assembly level and High level language (any four points) (2 marks) D) What will be the output for each of the following expressions? i) -25/3 %2 ii) (5/3) * 3 + 5 % 3 iii) -14 % 4 iv) (5/2.0 == 0.0 && 10/2.0!=0.0) || -6<0.0 (2 marks) (4 marks) (2 marks)
2. A) Draw a flowchart to find the largest of three given numbers. B) Convert the following, with all steps shown clearly i) 31.687510 to Binary ii) 10111.001112 to Decimal iii) 7038 to Hexadecimal iv) 43110 to Octal
C) Write a C++ program to count the prime digits in a given number. 3. A) Illustrate the steps involved in selection sort with a suitable example.
(4 marks) (2 marks)
B) Illustrate the usage of while loop and do-while loop by writing a C++ program to find the product of N natural numbers. (4 marks)
C) Explain entry-controlled and exit-controlled looping structures by clearly showing the flow of control. (4 marks)
4. A) Write a C++ program to (i) enter a string through the keyboard (ii) count the number of Uppercase letters (iii) replace the vowels present in the string with a character X (eg: if the entered string is UnIveRSItY, output should be XnXvXRSXtY). Do not use any string handling functions B) Compare and contrast structure and union.
(CSE-101)
(3 marks) (2 marks)
Page 1 of 2
(2 marks)
D) Write a C++ program to i) Accept the elements into an integer matrix A of order m x m ii) Print UPPER triangular matrix e.g.: 1 4 7 2 5 8 3 6 9 2 UPPER triangular matrix is 3 6
(3 marks)
5. A) Explain the following parameter passing techniques in functions with example for each i) Pass-by-value ii) Pass-by-reference (4 marks) (3 marks)
B) Write a C++ program to do the following tasks i) Read a number in the main program. ii) Write a function to reverse the number. [without using an array] C) Write a recursive function to compute the nth Fibonacci number.
(3 marks)
6. A) Requirement analysis and specification is mandatory in Software Life Cycle models, YES or NO. Justify the statement with points supporting your answer. (2 marks)
B) Define a class student to represent student details with member variables studName, studRoll, studMarks [total marks of all subjects]. The member function getInfo( ) reads the details of each student and dispInfo( ) displays the details. Create 2 objects to enter details of 2 students and display the entered details. C) Give the output for the following error free program
#include<iostream.h> void main() { func(); func(); } void func() { int x = 0; static int y = 0; x++; y++; cout<<"\n"<< x<< y ; }
(4 marks) (2 marks)
(2 marks)
(CSE-101)
Page 2 of 2