AP-1.1 Ankita
AP-1.1 Ankita
AP-1.1 Ankita
Subject Name:
Subject Code:
Submitted to: Submitted by:
Faculty name Name:
UID:
Section:
Group:
DEPARTMENT OF
COMPUTER SCIENCE & ENGINEERING
INDEX
Ex. List of Experiments Conduct Viva Record Total Remarks/Signature
No (MM: 12) (MM: 10) (MM: 8) (MM: 30)
1.1
1.2
1.3
2.1
2.2
2.3
2.4
3.1
3.2
3.3
DEPARTMENT OF
COMPUTER SCIENCE & ENGINEERING
Experiment 1.1
Student Name:Ankita Parida UID: 21BCS8988
Branch: BE-CSE Section: 636-A
Semester: 5th Date: 10-08-23
Subject Name: Advanced Programming Lab-1 Subject Code: 21CSP-314
3. Problem 1.1:
Pseudo Code:
Code:
#!/bin/python3
import math
import os
import random
import re
import sys
if _name_ == '_main_':
n = int(input())
for i in reversed(arr):
print(i,end=' ')
Output 1.1:
DEPARTMENT OF
COMPUTER SCIENCE & ENGINEERING
Problem 1.2:
Objective: Given an array of integers, find the sum of its elements. For example, if
the array ar = [1,2,3], 1+2+3 = 6, so return 6.
Pseudo Code:
Code:
Output 1.2:
1.3 Objective: Alice and Bob each created one problem for HackerRank. A reviewer
rates the two challenges, awarding points on a scale from 1 to 100 for three
categories: problem clarity, originality, and difficulty.
Code:
vector<int> result;
int aliceScore = 0;
int bobScore = 0;
for(int i=0;i<a.size();i++){
if(a[i] > b[i])
aliceScore ++;
else if(b[i] > a[i])
bobScore++;
}
result.push_back(aliceScore);
result.push_back(bobScore);
return result;
DEPARTMENT OF
COMPUTER SCIENCE & ENGINEERING
Output:
1.4 Objective: Given a square matrix, calculate the absolute difference between the sums
of its diagonals.
Output: