Practical
Practical
OUTPUT:
my name is kiran
Practical-2
6. Add 2 numbers.
#include<stdio.h>
#include<conio.h>
void main()
{
int a,b;
Clrscr();
Printf(“enter two numbers”);
Scanf(“%d%d”,&a,&b);
sum=a+b;
Printf(“addition = %d”,sum);
getch();
}
OUTPUT:
Enter two numbers32
4
addition=36
#include<stdio.h>
#include<conio.h>
void main()
{
int r;
float area;
Clrscr();
Printf(“enter the value”);
Scanf(“%d”,&r);
area=3.14*r*r;
Printf(“area of circle = %f”,area);
getch();
}
OUTPUT:
Enter the value3
area of circle = 28.26
#include<stdio.h>
#include<conio.h>
void main()
{
int r;
float area;
Clrscr();
Printf(“enter the value”);
Scanf(“%d,%d”,&a,&b);
Printf(“\nvalues before swapping\n a =%d\nb=%d”,a,b);
temp=a;
a=b;
b=temp;
Printf(“\n values after swapping\n a= %d\n b=%d,a,b);
getch();
}
OUTPUT:
enter the value12
5
value before swapping
a=12
b=5
value after swapping
a=5
b=12
10. Swap 2 numbers without 3rd variable