0% found this document useful (0 votes)
9 views

PSCP Endsem

The document is an end-semester examination paper for the MA144 course in Problem Solving and Computer Programming for I B.Tech. (ECE Sec C) students. It includes various programming questions, such as finding outputs of given code snippets, writing programs for complex number addition, insertion sorting, matrix multiplication, and recursive functions. The exam is scheduled for 27-02-2023, with a duration of 2.5 hours and a maximum score of 30 marks.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views

PSCP Endsem

The document is an end-semester examination paper for the MA144 course in Problem Solving and Computer Programming for I B.Tech. (ECE Sec C) students. It includes various programming questions, such as finding outputs of given code snippets, writing programs for complex number addition, insertion sorting, matrix multiplication, and recursive functions. The exam is scheduled for 27-02-2023, with a duration of 2.5 hours and a maximum score of 30 marks.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

DEPARTMENT OF MATHEMATICS

MA144: Problem Solving and Computer Programming


End-semester Examination (27-02-2023)
I B.Tech. (ECE Sec C) AY 2022-23 (odd semester)
Duration: 2.5 hrs Max. Marks: 30 Marks Secured:

Name of the Student: Roll No.:

Do submit the question paper along with the answer script.

1. What will be printed if you execute the following 3. Find out the output of the following program. [2M]
program? [2M]
int main()
int main() { int i,n=6;
{char a[100]="nit warangal"; int A[ ] = {4, 8, 6, 12, 9, 2};
char b[100]="end sem exam"; for (i=0; i<n; i++)
char c[100]="ece section C"; *(A+i) = *(A+n-1-i) = *(A+i);
int j,i = 0, count = 0; for (i=0; i<n; i++)
while (a[i] != '\0') { cout<<A[i]<<" ";
j = 0; return 0;
while (b[j] != '\0') { }
if (a[i] != b[j]) {
j++;
continue;
} else { 4. Find out the output of the following program. [2M]
count++;
break; int main() {
} int i, col, val,n=6;
} int arr[n-1][30];
i++; for(i = 1, val = 1; i < n;i++){
} col = i < n/2? i: i == n/2? i:(n-i);
cout<<count; int j;
return 0; for(j = 0; j<col;j++){
} arr[i-1][j] = val++;
cout<< arr[i-1][j]<<" ";
}
cout<<endl;
}
2. What would be the output of the following
return 0;
program? [2M]
}
int main()
{int i;
for(i = 1; i<20; i+5) 5. Write a program to add two complex numbers using
switch(i) classes and objects. [2M]
{cout<<i;
case 5: cout<<"5 "; 6. Write the insertion sorting algorithm and trace
break; the algorithm with the input 15 -4 20 -2 0 12
case 6: cout<<"6 "; [4M]
break; 7. Write a program to multiply two matrices using
case 11: cout<<"11 "; 2-D arrays. [4M]
break;
default: cout<<"0 "; 8. Write a program using recursive function that
break; takes as input an integer n and returns the sum of all
its digits that are ≤ 3. (For example, on input
}
n=23709, the output should be 5) [4M]
cout<<"end-sem exam";
return 0; 9. Write a program for binary search using recursion.
} [4M]
10. Write a program to sort strings using structures. [4M]
***GOOD LUCK***

You might also like