Computer Final Chap Wise Phases Xii
Computer Final Chap Wise Phases Xii
Q#2: Define endl and setw manipulators and give an example of each.
Continuous
iii. While loop is also called: Counter loop Wend loop Conditional loop
loop
One execution of a loop structure
iv. is called: Cycle Duration Iteration Test
SECTION – B
i. Differentiate between break statement and exit function.
ii. Write the purpose of default statement in switch statement.
iii. Write a program that inputs three numbers from user and displays the greater one.
iv. Write the purpose of break statement in switch statement.
v. Write a program to check if a character entered by the user is a vowel (a, e, i, o, u) or a consonant using an if-
else statement.
vi. Converts the following loop into do-while loop.
for (int n=10; n>=5; n--)
cout<<” ABICS”;
vii. Write a program to check if a number is divisible by both 5 and 11 using nested if statements.
viii. Display the output by using while loop:
3 5 7 9 11 13 15 17 19 21
SECTION – C
Q#1: Write a program to perform basic arithmetic operations (+, -, *, /) based on user input using a switch
statement.
Q#2: Write the nested loop that will print the following pattern:
1 2 3 4 5
1 2 3 4
1 2 3
1 2
1
SECTION – B
i. Declare an array named x that has 5 rows and 3 columns and assign it values from 1-15 in the declaration
statement.
ii. Differentiate between array size and array indexes.
iii. What are subscripts in an array? Draw graphically.
iv. Can we start array index with other number than zero? Justify (yes or no).
v. Differentiate b/w strcmp() and strcat().
vi. What is advantage of using cin.get () function over cin statement for reading string?
vii. For the given array:int Arr[10]={5,6,99,5,32,12,5,89,65,5};
write a program that prints the number of times the number 5 appears in the array.
viii. Write a program that reads two string, copies it into another string and then prints both strings.
ix. Differentiate b/w strcat() and strcpy().
x. Write a program that reads two string and then prints the length of both strings.
SECTION – C
Q#1: Write a program that reads 3 strings and prints the smallest.
Q#2: Write a program that print sum of an array that has size 10 (20,30,40,5,4,6,7,8,10,19).
Q#3: Write a program that prints the given array in reverse order: (20,30,40,5,4,6,7,8,10,19).