Pps Lab Ex
Pps Lab Ex
2.B Write a C program to find the difference between the driving speed of two participants in a sinle
line.
3.B. You are given a task to rotate an array to the right by a specified number of positions.
Your program should be able to handle multiple test cases and print the results in a single line
for each test case.
Input Format
1. The first line contains a single integer TTT (1 ≤ TTT ≤ 100) denoting the number of
test cases.
2. For each test case:
o The first line contains two integers NNN (1 ≤ NNN ≤ 1000) and KKK (0 ≤
KKK ≤ 1000), where NNN is the number of elements in the array and KKK is
the number of positions to rotate the array.
o The second line contains NNN space-separated integers, representing the
elements of the array.
Output Format
For each test case, print the rotated array on a new line in a single line format.
4.B You are given an array of integers. Your task is to find and print the maximum value
from all possible pairs of integers in the array.
Input Format
The first line contains an integer NNN (2 ≤ NNN ≤ 1000), the number of elements in
the array.
The second line contains NNN space-separated integers, representing the elements of
the array.
Output Format
Print a single integer that represents the maximum of all pairs from the array.
5.B. Write a C program that checks if the input string contains only lowercase letters (from 'a' to 'z').
If the input meets this condition, it prints "a program"; otherwise, it prints "not a program."
6.A.Write a Cprogram to create a Structure.
6.B. You are required to create a C program that manages student information using structures. The
program should store and display details for multiple students, including their department, name,
year of study, and CGPA.
7.B. To compute the area of a triangle using Python, you can use the formula:
Area=1/2×base×height
9.B. You are tasked with creating a seating layout for a theater. The program should allow the
user to specify the number of rows and columns in the seating arrangement, and then display
the layout.