0% found this document useful (0 votes)
8 views21 pages

KK HTML

Uploaded by

ap9621747627
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)
8 views21 pages

KK HTML

Uploaded by

ap9621747627
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
You are on page 1/ 21

1

IIMT COLLEGE OF MANAGEMENT


Gr.NOIDA

PPA PRACTICAL
Branch/Year-BCA/2nd
SECTION:- A
Submitted To: Submitted By:

Mrs. LAXMI SOROUT NAME:- ADITYA PRAJAPATI


ASSISTANT PROFESSOR ROLL NO. 87964T2400353M027

BCA DEPARTMENT ADDMISSION NO. 53240066


2

PROGRAMme 1:-( PRINT HELLO WORD)


/* wap to print a text in c */
#include<stdio.h>
#include<conio.h>
void main()
{
printf("Hello World");
getch();
clrscr();
}

PROGRAMme 2:-(print my name)


#include<stdio.h>
#include<conio.h>
void main()
{
printf("My name ia ADitya Prajapati\n");
printf("Course-BCA 1 semester\n");
getch();
clrscr();
}
3

PROGRAMme 3:- (use of sizeof)


#include<stdio.h>
#include<conio.h>
void main()
{
printf("%lu\n",sizeof(char));
printf("%lu\n",sizeof(int));
printf("%lu\n",sizeof(float));
printf("%lu\n",sizeof(double));
getch();
clrscr();
}
4

Programme 4:- (add two words by new


integers)
// program to add two number//
#include<stdio.h>
#include<conio.h>
void main()
{
int a=2,b=5,c;
c=a+b;
printf("c=%d",c);
getch();
clrscr();

Programme 5:-(arithmetic operation)


#include<stdio.h>
#include<conio.h>
void main()
5

{
int a=10,b=20;
printf("a+b=%d",a+b);
printf("a-b=%d",a-b);
printf("a*b=%d",a*b);
printf("a/b=%d",a/b);
printf("a%b=%d",a%b);
getch();
clrscr();

Programme 6:-(assignment operators


program)
#include<stdio.h>
#include<conio.h>
void main()
{
int a,b,c,d;
6

a=3;
b=10;
c=a*b;
d=c;
printf("\n a=%d,b=%d,c=%d,c=%d",a,b,c,d);
getch();
clrscr();
}

Programme 7:-(find out area pf rectangle)


#include<stdio.h>
#include<conio.h>
void main()
{
int Length=10;
int Width=25;
int Area=Length*Width;
printf("Area=%d",Area);
7

getch();
clrscr();}

programme 8:-(increment)
#include<stdio.h>
#include<conio.h>
void main()
{
int a=5,b,c,d;
b=++a;
c=a++;
d=++a;
printf("%d",a);
getch();
clrscr();
8

Programme 9:-(decrement)

#include<stdio.h>
#include<conio.h>
void main()
{
int a=5,b,c,d;
b=--a;
c=a--;
d=--a;
printf("%d",a);
getch();
clrscr();
}
9

Programme 10:- (use of logical operator)

#include<stdio.h>
#include<conio.h>
void main()
{
int a=16,b=6;
printf("%d\n",(a<b)&&(a>b));
printf("%d\n",(a<b)||(a>b));
printf("%d\n",!(a==b));
getch();
clrscr();
}
10

Programme 11:- (add two words by sum)


#include<stdio.h>
#include<conio.h>
void main()
{
int a=10,b=30,sum;
sum=a+b;
printf("the sum of a and b is %d ",sum);
getch();
clrscr();
}
11

Programme 12:- (substract two words by


sub)

#include<stdio.h>
#include<conio.h>
void main()
{
int a=90,b=30,sub;
sub=a-b;
printf("the sub of a and b is %d ",sub);
getch();
clrscr():; }
12

Programme 13:- (multiply two words by mul)


#include<stdio.h>
#include<conio.h>
void main()
{
int a=90,b=30,mul;
mul=a*b;
printf("the mul of a and b is %d ",mul);
getch();
clrscr();
}
13

Programme 14:- (division two words by div)


#include<stdio.h>
#include<conio.h>
void main()
{
int a=90,b=30,div;
div=a/b;
printf("the div of a and b is %d ",div);
getch();
clrscr();
}

Programme 15:- (shortcut of upper


programe)
#include<stdio.h>
#include<conio.h>
void main()
{
int a,b,sum,sub,mul,div;
printf("Enter the value of a");
14

scanf("%d",&a);
printf("Enter the value of b");
scanf("%d",&b);
sum=a+b;
sub=a-b;
mul=a*b;
div=a/b;
printf("the value of sum is %d",sum);
printf("the value of sub is %d",sub);
printf("the value of mul is %d",mul);
printf("the value of div is %d",div);
getch();
clrscr();
}

Programme 16:- (addition of five subject)


//add five subject//
#include<stdio.h>
#include<conio.h>
void main()
{
15

int math,science,computer,ppa,bc,sum;
printf("Enter the value of math");
scanf("%d",&math);
printf("Enter the value of science");
scanf("%d",&science);
printf("Enter the value of computer");
scanf("%d",&computer);
printf("Enter the value of ppa");
scanf("%d",&ppa);
printf("Enter the value of bc");
scanf("%d",&bc);
sum= math+science+bc+ppa+computer;
printf("the value of sum is %d",sum);
getch();
clrscr();
}
16

Programme 17:- (percentage of five subject)


//percentage five subject//
#include<stdio.h>
#include<conio.h>
void main()
{
float math,science,computer,ppa,bc,sum,percentage;
printf("Enter the value of math");
scanf("%f",&math);
printf("Enter the value of science");
scanf("%f",&science);
printf("Enter the value of computer");
scanf("%f",&computer);
printf("Enter the value of ppa");
scanf("%f",&ppa);
printf("Enter the value of bc");
scanf("%f",&bc);
sum= math+science+bc+ppa+computer;
percentage=(sum/500)*100;
printf("the value of percentage is %.2f",percentage);
getch();
clrscr(); }

PROGRAmME 18:- ( AREA OF SQUARE )


17

#include<stdio.h>
#include<conio.h>
void main()
{
int a,area;
printf("enter the value of a");
scanf("%d",&a);
area= a*a;
printf("the are of square is %d",area);
getch();
clrscr();
}

Programme 19:- (parameter of rectangle)


#include<stdio.h>
#include<conio.h>
void main()
{
int a,parameter,b;
printf("enter the value of a");
scanf("%d",&a);
printf("enter the value of b");
scanf("%d",&b);
parameter=2*(a+b);
printf("the are of parameter is %d",parameter);
18

getch();
clrscr();
}

Programme 20:- (use of relational operator)


#include<stdio.h>
#include<conio.h>
void main()
{
int a=9, b=3, c=5, d=2, e=5;
printf("%d",a<b);
printf("%d",c>d);
printf("%d",e=c);
getch();
clrscr();
}
19

Programme 21:- (wap to calculate simple


intrese)
#include<stdio.h>
#include<conio.h>
void main()
{
float p,r,t,SI;
printf("Enter the value of p,r,t");
scanf("%f%f%f",&p,&r,&t);
SI=p*r*t/100;
printf("the value of simple intrese is %.2f",SI);
getch();
clrscr();
}
20

Programmme 22:- (swapping)


#include<stdio.h>
#include<conio.h>
void main()
{
int x,y;
printf("Enter the value of x and y");
scanf("%d%d",&x,&y);
printf("The value of x and y before swapping is %d%d",x,y);
x=x+y;
y=x-y;
x=x-y;
printf("the value of x and y after swapping is %d%d",x,y);
getch();
clrscr();
}
21

Programme 23:-

You might also like