Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions Add two no. without using third variable.CPP
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
#include<conio.h>
void main()
{ clrscr();
int a,b;
int a,b,c;
printf("Enter a:");
scanf("%d",&a);
printf("Enter b:");
scanf("%d",&b);
a=a+b;
printf("Sum=%d",a);
c=a+b;
printf("Sum=%d",c);
getch();
}
}
8 changes: 4 additions & 4 deletions Area of rectangle.CPP
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
void main()
{ clrscr();
float l,b,a;
printf("Enter breath : ");
printf("Enter the breath of the rectangle : ");
scanf("%f",&b);
printf("Enter length : ");
printf("Enter the length of the rectangle : ");
scanf("%f",&l);
a=b*l;
printf("Area of rectangle=%.2f",a);
printf(" The Area of the rectangle is =%.2f",a);
getch();
}
}
15 changes: 10 additions & 5 deletions Arrange in accending order.CPP
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,18 @@
void main()
{ clrscr();
int a[10],i,j,k;
printf("Enter elements\n");
printf("Enter the elements in the array\n");
for(i=0;i<10;i++)
{
scanf("%d",&a[i]);
}
for(k=0;k<10;k++)
{ for(i=0;i<9;i++)
{ if(a[i]>a[i+1])
{ j=a[i];
{
for(i=0;i<9;i++)
{
if(a[i]>a[i+1])
{
j=a[i];
a[i]=a[i+1];
a[i+1]=j;
}
Expand All @@ -20,4 +25,4 @@ void main()
for(i=0;i<10;i++)
printf("%d\n",a[i]);
getch();
}
}