0% found this document useful (0 votes)
3 views20 pages

Android File

This document is a practical file for the Programming and Problem-Solving Lab (PMC 103) for the MCA course, semester 1, session 2025-26, submitted by Aman Singh Rawat. It includes a certification of completion of laboratory experiments, a report sheet for practicals, and various C programming exercises with objectives and code implementations. Acknowledgments are also provided to the faculty and peers for their support during the completion of the practical work.

Uploaded by

amanrawat2202
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views20 pages

Android File

This document is a practical file for the Programming and Problem-Solving Lab (PMC 103) for the MCA course, semester 1, session 2025-26, submitted by Aman Singh Rawat. It includes a certification of completion of laboratory experiments, a report sheet for practicals, and various C programming exercises with objectives and code implementations. Acknowledgments are also provided to the faculty and peers for their support during the completion of the practical work.

Uploaded by

amanrawat2202
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

HALDWANI CAMPUS

PRACTICAL FILE
SUBJECT NAME : PROGRAMMING AND PROBLEM-SOLVING LAB
SUBJECT CODE : PMC 103
COURSE : MCA
SEMESTER : 1st
SESSION : 2025-26

SUBMITTED TO SUBMITTED BY
[Link] TRIPATHI
AMAN SINGH RAWAT
DEPARTMENT OF COMPUTER SCIENCE
& APPLICATION

COLLEGE ROLL NO. :- EXAMINATION ROLL NO. :-


HALDWANI CAMPUS

THIS IS TO CERTIFY THAT MS AMAN SINGH RAWAT HAS SATISFACTORILY


COMPLETED ALL THE EXPERIMENTS IN THE LABORATORY OF THIS COLLEGE.
THE COURSE OF THE EXPERIMENTS IN PARTIAL FULLFILLMENT OF THE
REQUIREMENT IN 1s SEMESTER OF MCA DEGREE COURSE PRESCRIBED BY
GRAPHIC ERA HILL UNIVERSITY, HALDWANI DURING THE YEAR 2025-2026

CONCERNED FACULTY HEAD OF DEPARTMENT

NAME OF EXAMINER:
SIGNATURE OF EXAMINER:
DEPARTMENT OF COMPUTER SCIENCE& APPLICATION
STUDENT LAB REPORT SHEET
Programming and Problem-Solving Lab (PMC-103)

Name of Student ……………………………………...……………………………..……. Mo. No…………………….……….…………..

Address Permanent ……………………………………………………………………………………..…………………………..………..

Father’s Name …………………………………..………………………………………… Mo. No…………………………………………

Mother’s Name ……………………………………………………………………………. Mo. No……………………………..…………..

Section ……..……..……. Branch………………………… Semester……….………….. Class Roll No …………………….………..

Local Address……………………………………………………..……Email…………………………………………………..…………..
Grade A B C
Marks 5 3 1
[Link]. Name of the Experiment D.O.P. Date of Grade Grade Total Marks Student’s Teacher’s
Submission (Viva) (Report (out of 10) Signature Signature
File)

10

11

12

13

14

15

Total No of Practical allotted ……………………………………….


Total No of Practical completed ……………………………………
Percentage Attendance of Practical ………………………………..
ACKNOWLEDGEMENT

I would like to express my gratitude to Mr. Malay Tripathi for their


guidance and support throughout the completion of this practical file.
Their valuable insights and encouragement have been instrumental in
enhancing my understanding of the subject. Would also like to
acknowledge my friends for their collaboration and help. Thank you all
for your contributions to the successful completion of this practical
work.

AMAN SINGH RAWAT


AMANSINGHRAWAT.25201300438@[Link]
PROGRAM – 1

NAME :- AMAN SINGH RAWAT


COURSE :- MCA
SEMESTER :- 1ST
ROLL NO. :-

OBJECTIVE : WRITE A C PROGRAM TO SWAP TWO NUMBERS WITHOUT USING


3RD VARIABLE

PROGRAM:

#include<stdio.h>

void main(){

int a,b;

printf("Enter the first number:");

scanf("%d",&a);

printf("Enter the second number:");

scanf("%d",&b);

a=a+b;

b=a-b;

a=a-b;

printf("The value after swapping are:a=%d b=%d",a,b);

}
PROGRAM – 2

NAME :- AMAN SINGH RAWAT


COURSE :- MCA
SEMESTER :- 1st
ROLL NO. :-

OBJECTIVE : WRITE A C PROGRAM TO FIND AREA OF A TRIANGLE

PROGRAM:

#include <stdio.h>

void main() {

float base, height, area;

printf("Enter the base of the triangle: ");

scanf("%f", &base);

printf("Enter the height of the triangle: ");

scanf("%f", &height);

area = 0.5 * base * height;

printf("The area of the triangle is: %.2f\n", area);

}
PROGRAM – 3

NAME :- AMAN SINGH RAWAT


COURSE :- MCA
SEMESTER :- 1st
ROLL NO. :-

OBJECTIVE : WRITE A C PROGRAM TO CONVERT GIVEN VELOCITY KM/HR TO


M/SEC.

PROGRAM:

#include <stdio.h>

void main() {

float velk, velm;

printf("Enter velocity in km/hr: ");

scanf("%f", &velk);

velm = velk * (5.0/18.0);

printf("Velocity in m/sec: %.2f\n", velm);

}
PROGRAM – 4

NAME :- AMAN SINGH RAWAT


COURSE :- MCA
SEMESTER :- 1st
ROLL NO. :-

OBJECTIVE : A YEAR APPROXIMATELY CONSISTS OF 3.156 × 107 SECONDS. WRITE


A C PROGRAM THAT ACCEPTS YOUR AGE IN YEARS AND CONVERTS IT INTO
EQUIVALENT NUMBER OF SECONDS.

PROGRAM:

#include <stdio.h>

void main() {

int age;

float age_in_sec;

printf("Enter your age in years: ");

scanf("%d", &age);

age_in_sec = 3.156E7*age;

printf("Your age in seconds = %5.2f", age_in_sec);

}
PROGRAM – 5

NAME :- AMAN SINGH RAWAT


COURSE :- MCA
SEMESTER :- 1st
ROLL NO. :-

OBJECTIVE : WRITE A PROGRAM IN C TO CONVERT THE TEMPERATURE GIVEN


IN FAHRENHE IT TO CELSIUS.

PROGRAM:

#include <stdio.h>

void main() {

float f, c;

printf("Enter temperature in Fahrenheit: ");

scanf("%f", &f);

c = (f - 32) * 5 / 9;

printf("Temperature in Celsius: %6.2f", c);

}
PROGRAM – 6

NAME :- AMAN SINGH RAWAT


COURSE :- MCA
SEMESTER :- 1st
ROLL NO. :-

OBJECTIVE : WRITE A C PROGRAM TO FIND THE AREA AND CIRCUMFERENCE OF


A CIRCLE WITH RADIUS R.

PROGRAM:

#include <stdio.h>

void main() {

float r, area, cir;

printf("Enter radius: ");

scanf("%f", &r);

area = 3.14 * r * r;

cir = 2 * 3.14 * r;

printf("Area = %6.2f\n", area);

printf("Circumference = %6.2f\n", cir);

}
PROGRAM – 7

NAME :- AMAN SINGH RAWAT


COURSE :- MCA
SEMESTER :- 1st
ROLL NO. :-

OBJECTIVE : WRITE A C PROGRAM TO FIND THE AVERAGE OF THREE NUMBERS.

PROGRAM:

#include <stdio.h>

void main() {

float a, b, c, avg;

printf("Enter three numbers: ");

scanf("%f %f %f", &a, &b, &c);

avg = (a + b + c) / 3.0;

printf("Average = %6.2f", avg);

}
PROGRAM – 8

NAME :- AMAN SINGH RAWAT


COURSE :- MCA
SEMESTER :- 1st
ROLL NO. :-

OBJECTIVE : WRITE A C PROGRAM TO FIND AREA OF A TRIANGLE WHOSE SIDES


ARE A, B AND C?

PROGRAM:

#include <stdio.h>

#include <math.h>

void main() {

float a, b, c, s, area;

printf("Enter sides a, b and c: ");

scanf("%f %f %f", &a, &b, &c);

s = (a + b + c) / 2;

area = sqrt(s * (s - a) * (s - b) * (s - c));

printf("Area of triangle = %6.2f", area);

}
PROGRAM – 9

NAME :- AMAN SINGH RAWAT


COURSE :- MCA
SEMESTER :- 1st
ROLL NO. :-

OBJECTIVE : AN OBJECT UNDERGOES UNIFORMLY ACCELERATED MOTION. THE


INITIAL VELOCITY (U) OF THE OBJECT AND THE ACCELERATION (A) ARE KNOWN.
WRITE A C PROGRAM TO FIND THE VELOCITY (V) OF THE OBJECT AFTER TIME T.

PROGRAM:

#include <stdio.h>
void main() {
float u, a, t, v;
printf("Enter initial velocity (u): ");
scanf("%f", &u);
printf("Enter acceleration (a): ");
scanf("%f", &a);
printf("Enter time (t): ");
scanf("%f", &t);
v = u + a * t;
printf("Final velocity = %f", v);

}
PROGRAM – 10

NAME :- AMAN SINGH RAWAT


COURSE :- MCA
SEMESTER :- 1st
ROLL NO. :-

OBJECTIVE : WRITE A C PROGRAM FIND ONE'S AND TWO'S COMPLEMENT OF A


NUMBER.

PROGRAM:

#include <stdio.h>
int main()
{
int num, oc, tc;
printf("Enter number:\t");
scanf("%d", &num);
oc = ~num; // One's complement
tc = oc + 1; // Two's complement
printf("One’s complement is %d\n", oc);
printf("Two’s complement is %d\n", tc);
return 0;
}
PROGRAM – 11

NAME :- AMAN SINGH RAWAT


COURSE :- MCA
SEMESTER :- 1st
ROLL NO. :-

OBJECTIVE : ASSUMING THAT BIT NUMBERING STARTS FROM 1. WRITE A C


PROGRAM TO SET A PARTICULAR BIT IN A GIVEN NUMBER.

PROGRAM:

#include <stdio.h>
int main() {
int num, bit, temp;
printf("Enter number: ");
scanf("%d", &num);
printf("Enter bit position to set: ");
scanf("%d", &bit);
temp = 1 << (bit - 1);
num = num | temp;
printf("Result after setting bit %d = %d", bit, num);
return 0;
}
PROGRAM - 12

NAME :- AMAN SINGH RAWAT


COURSE :- MCA
SEMESTER :- 1st
ROLL NO. :-

OBJECTIVE : ASSUMING THAT BIT NUMBERING STARTS FROM 1. WRITE A C


PROGRAM TO NEGATE A PARTICULAR BIT IN A GIVEN NUMBER.

PROGRAM:

#include <stdio.h>

void main() {

int num, bit, temp;

printf("Enter number: ");

scanf("%d", &num);

printf("Enter bit position to negated: ");

scanf("%d", &bit);

temp = 1 << (bit - 1);

num = num ^ temp;

printf("Result after negating bit %d = %d", bit, num);

}
PROGRAM – 13

NAME :- AMAN SINGH RAWAT


COURSE :- MCA
SEMESTER :- 1st
ROLL NO. :-

OBJECTIVE : GIVEN TWO NUMBERS, SAY VAL AND KEY. WHEREVER THE BITS OF
NUMBER KEY ARE 1, SET THE CORRESPONDING BITS OF NUMBER VAL. LEAVE ALL
OTHER BITS OF NUMBER VAL UNCHANGED.

PROGRAM:

#include <stdio.h>

void main() {

int val, key;

printf("Enter value: ");

scanf("%d", &val);

printf("Enter key: ");

scanf("%d", &key);

val = val | key;

printf("After setting bits result = %d", val);

}
PROGRAM – 14

NAME :- AMAN SINGH RAWAT


COURSE :- MCA
SEMESTER :- 1st
ROLL NO. :-

OBJECTIVE : GIVEN TWO NUMBERS, SAY VAL AND KEY. WHEREVER THE BITS OF
NUMBER KEY ARE 1, NEGATE THE CORRESPONDING BITS OF NUMBER VAL. LEAVE
ALL OTHER BITS OF NUMBER VAL UNCHANGED.

PROGRAM:

#include <stdio.h>

void main() {

int val, key;

printf("Enter value: ");

scanf("%d", &val);

printf("Enter key: ");

scanf("%d", &key);

val = val ^ key;

printf("After negating bits result = %d", val);

}
PROGRAM – 15

NAME :- AMAN SINGH RAWAT


COURSE :- MCA
SEMESTER :- 1st
ROLL NO. :-

OBJECTIVE : WRITE A C PROGRAM TO MULTIPLY A GIVEN NUMBER WITH 2^N,


WITHOUT USING A MULTIPLICATION OPERATOR. THE VALUE OF N WILL BE
ENTERED BY THE USER.

PROGRAM:

#include <stdio.h>
void main() {
int num, n, res;
printf("Enter number to be multiplied\t");
scanf("%d", &num);
printf("Enter the value of n\t");
scanf("%d", &n);
res = num << n; // num * 2^n
printf("Result of multiplication is %d", res);
}

You might also like