Harshit Pandey
Harshit Pandey
Section - A
Branch - C.S.E
*/
#include<stdio.h>
int main() {
float f, c;
scanf("%f", &c);
f = c * 1.8 + 32;
return 0;
/*
OUTPUT:
*/
/*
Section - A
Branch - C.S.E
*/
#include<stdio.h>
#include<math.h>
int main() {
si = (p * r * t) / 100;
ci = A - p;
return 0;
/*
OUTPUT:
500 2 1
*/
/*
Section - A
Branch - C.S.E
*/
#include<stdio.h>
int main() {
scanf("%f", &bas_sal);
ta = bas_sal * 5 / 100;
da = bas_sal * 3 / 100;
return 0;
/*
OUTPUT:
200
*/
/*
Section - A
Branch - C.S.E
*/
#include<stdio.h>
int main() {
int num;
scanf("%d", &num);
if (num % 2 == 0)
else
return 0;
/*
OUTPUT:
*/
/*
Section - A
Branch - C.S.E
*/
#include<stdio.h>
int main() {
int num;
scanf("%d", &num);
if (num > 0)
else
return 0;
/*
OUTPUT:
*/
/*
Section - A
Branch - C.S.E
*/
#include<stdio.h>
int main() {
large = num1;
large = num2;
large = num3;
return 0;
/*
OUTPUT:
34 67 44
Largest number is 67
*/
/*
Section - A
Branch - C.S.E
*/
#include<stdio.h>
int main() {
scanf("%f", &unit);
rate = 7;
rate = 6;
else
rate = 5;
return 0;
/*
OUTPUT:
BILL: 21000.000000
BILL: 12000.000000
BILL: 2500.000000 */
/*
Section - A
Branch - C.S.E
*/
#include<stdio.h>
int main() {
printf("Grade A");
printf("Grade B");
printf("Grade C");
else
printf("Grade D");
return 0;
/*
OUTPUT:
97 89 88 95
Grade A
33 23 27 20
Grade D
*/
/*
Section - A
Branch - C.S.E
*/
#include<stdio.h>
int main() {
scanf("%d", &m_qty);
bill = 5 * m_qty;
return 0;
/*
OUTPUT:
Bill: 250
Bill: 900
*/
/*
Section - A
Branch - C.S.E
*/
#include<stdio.h>
int main() {
int year;
scanf("%d", &year);
if (year % 4 == 0)
else
return 0;
/*
OUTPUT:
*/
/*
Section - A
Branch - C.S.E
*/
#include<stdio.h>
#include<math.h>
int main() {
int a, b, c;
float s, area;
s = (float)(a + b + c) / 2;
} else
return 0;
/*
OUTPUT:
*/
/*
Section - A
Branch - C.S.E
*/
#include<stdio.h>
#include<math.h>
int main() {
d = b * b - 4 * a * c;
if (d > 0) {
} else
return 0;
/*
OUTPUT:
*/
/*
Section - A
Branch - C.S.E */
#include<stdio.h>
int main() {
char c;
scanf("%c", &c);
printf("Digit");
else
printf("Special symbol");
return 0;
/* OUTPUT:
Enter a character: a
Enter a character: A
Enter a character: 9
Digit
Enter a character: #
Special symbol */
/*
Source code to find the sum of even and odd numbers between two integers
Section - A
Branch - C.S.E
*/
#include<stdio.h>
int main() {
if (i % 2 == 0)
sume += i;
else
sumo += i;
return 0;
/*
OUTPUT:
*/
/*
Section - A
Branch - C.S.E
*/
#include<stdio.h>
int main() {
int i, n, num;
scanf("%d", &n);
scanf("%d", &num);
return 0;
/*
OUTPUT:
Enter a number: 4
The square of 4 is 16
Enter a number: 5
The square of 5 is 25
Enter a number: 6
The square of 6 is 36
*/
/*
Section - A
Branch - C.S.E
*/
#include<stdio.h>
void main() {
scanf("%d", &n);
if (c <= 1)
next = c;
else {
first = second;
second = next;
/*
OUTPUT:
01123 */
/*
Section - A
Branch - C.S.E
*/
#include<stdio.h>
int main() {
scanf("%d", &n);
while (n != 0) {
remainder = n % 10;
n = n / 10;
return 0;
/*
OUTPUT:
Sum of digits: 6
*/
/*
Section - A
Branch - C.S.E
*/
#include<stdio.h>
int main() {
scanf("%d", &num);
temp = num;
while (num != 0) {
if (temp == sum)
else
return 0;
/*
OUTPUT:
Section - A
Branch - C.S.E
*/
#include<stdio.h>
int main() {
scanf("%d", &num);
temp = num;
while (num != 0) {
if (rev == temp)
else
return 0;
/*
OUTPUT:
121 is a palindrome.
Section - A
Branch - C.S.E
*/
#include<stdio.h>
int main() {
int i, n, sign = 1;
float sum = 0;
scanf("%d", &n);
for (i = 1; i <= 2 * n - 1; i += 2) {
sign *= -1;
return 0;
/*
OUTPUT:
*/
/*
Section - A
Branch - C.S.E.
*/
#include<stdio.h>
void main() {
int n, i, j, k;
scanf("%d", &n);
printf(" ");
printf("*");
printf("\n");
/*
OUTPUT:
*****
****
***
**
*/
/*
Section - A
Branch - C.S.E.
*/
#include<stdio.h>
void main() {
scanf("%d", &n);
scanf("%d", &arr[i]);
scanf("%d", &key);
if (arr[i] == key) {
found = 1;
break;
if (!found)
/*
OUTPUT:
Enter 5 elements: 1 2 3 4 5
*/
/*
Source code to find the maximum and minimum elements in a 1-D array
Section - A
Branch - C.S.E
*/
#include<stdio.h>
int main() {
scanf("%d", &n);
scanf("%d", &arr[i]);
max = arr[i];
min = arr[i];
return 0;
/*
OUTPUT:
Enter 5 elements:
10 20 5 15 25
Maximum element: 25
Minimum element: 5
*/
/*
Section - A
Branch - C.S.E
*/
#include<stdio.h>
int i, j, temp;
temp = arr[j];
arr[j + 1] = temp;
int main() {
int arr[50], n, i;
scanf("%d", &n);
scanf("%d", &arr[i]);
sort(arr, n);
printf("Sorted array:\n");
for (i = 0; i < n; i++)
return 0;
/*
OUTPUT:
Enter 5 elements:
30 10 50 20 40
Sorted array:
10 20 30 40 50
*/
/*
Section - A
Branch - C.S.E
*/
#include<stdio.h>
int main() {
scanf("%d", &arr1[i]);
scanf("%d", &arr2[i]);
printf("Sum of arrays:\n");
return 0;
}
/*
OUTPUT:
10 20 30
12
Sum of arrays:
11 22 30
*/
/*
Section - A
Branch - C.S.E
*/
#include<stdio.h>
#define SIZE 3
int main() {
int mat[SIZE][SIZE], i, j;
scanf("%d", &mat[i][j]);
if (j <= i)
else
printf(" ");
printf("\n");
if (j >= i)
else
printf(" ");
printf("\n");
return 0;
/*
OUTPUT:
123
456
789
45
789
123
56
*/
/*
Section - A
Branch - C.S.E
*/
#include<stdio.h>
int sum(int n) {
return (n * (n + 1)) / 2;
int main() {
int n, result;
scanf("%d", &n);
result = sum(n);
return 0;
/*
OUTPUT:
Enter a number: 5
*/
/*
Section - A
Branch - C.S.E
*/
#include<stdio.h>
if (num <= 1)
return 0;
if (num % i == 0)
return 0;
return 1;
int main() {
int num;
scanf("%d", &num);
if (is_prime(num))
else
return 0;
}
/*
OUTPUT:
Enter a number: 7
7 is a prime number
Enter a number: 4
*/
/*
Section - A
Branch - C.S.E
*/
#include<stdio.h>
int sum_of_digits(int n) {
if (n == 0)
return 0;
int main() {
scanf("%d", &num);
result = sum_of_digits(num);
return 0;
/*
OUTPUT:
Sum of digits: 6
*/
/*
Section - A
Branch - C.S.E
*/
#include<stdio.h>
int factorial(int n) {
if (n <= 1)
return 1;
int main() {
int n, r, result;
printf("Enter n: ");
scanf("%d", &n);
printf("Enter r: ");
scanf("%d", &r);
if (n < r) {
return 0;
}
result = nCr(n, r);
return 0;
/*
OUTPUT:
Enter n: 5
Enter r: 2
nCr = 10
*/