Skip to content

Commit f798c97

Browse files
committed
π…π’π§πšπ₯ 𝐏𝐫𝐨𝐣𝐞𝐜𝐭
0 parents  commit f798c97

File tree

158 files changed

+4098
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

158 files changed

+4098
-0
lines changed

β€Ž11.CPP

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#include<stdio.h>
2+
#include<conio.h>
3+
main()
4+
{
5+
float a,b,c,d;
6+
clrscr();
7+
printf("Enter Principal Value: ");
8+
scanf("%f",&a);
9+
printf("Enter Rate Of Interest (In %): ");
10+
scanf("%f",&b);
11+
printf("Enter Time (In Yrs.): ");
12+
scanf("%f",&c);
13+
d=a*b*c/100;
14+
printf("\nSimple Interest Is: %f",d);
15+
getch();
16+
}

β€Ž12.CPP

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#include<stdio.h>
2+
#include<conio.h>
3+
main()
4+
{
5+
int a,b,c,d;
6+
clrscr();
7+
printf("Enter Precentage Of Student= ");
8+
scanf("%d",&a);
9+
if (a>=80)
10+
{
11+
printf("\nStudent Will Pass From A Grade");
12+
}
13+
else if (a>=60&&a<=80)
14+
{
15+
printf("\nStudent Will Pass From B Grade");
16+
}
17+
else if (a>=40&&a<=60)
18+
{
19+
printf("\nStudent Will Pass From C Grade");
20+
}
21+
else if (a<=40)
22+
{
23+
printf("\nStudent Will Pass From D Grade");
24+
}
25+
getch();
26+
}
27+

β€Ž13.CPP

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#include<stdio.h>
2+
#include<conio.h>
3+
main()
4+
{
5+
int a,b,c,d;
6+
clrscr();
7+
printf("Enter 1st Side Of Triangle: ");
8+
scanf("%d",&a);
9+
printf("Enter 2nd Side Of Triangle: ");
10+
scanf("%d",&b);
11+
printf("Enter 3rd Side Of Triangle: ");
12+
scanf("%d",&c);
13+
if(a+b>c&&b+c>a&&a+c>b)
14+
{
15+
printf("\nTriangle Can Be Made From Given Sides");
16+
}
17+
else
18+
{
19+
printf("\nTriangle Can't Be Made From Given Sides");
20+
}
21+
getch();
22+
}

β€Ž14.CPP

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#include<stdio.h>
2+
#include<conio.h>
3+
main()
4+
{
5+
int a,b,c;
6+
clrscr();
7+
printf("Enter An Integer Between 100 and 200: ");
8+
scanf("%d",&a);
9+
if (a>=100&&a<=200)
10+
{
11+
b=a/7;
12+
printf("\nGiven Integer Is Divisible By 7");
13+
}
14+
else if
15+
{
16+
printf("\nGiven Number Is Not Divisible By 7");
17+
}

β€Ž1HM.CPP

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#include<stdio.h>
2+
#include<conio.h>
3+
main()
4+
{
5+
int n,q,r,s;
6+
clrscr();
7+
printf("Enter An Integer= ");
8+
scanf("%d",&n);
9+
q=n;
10+
s=0;
11+
while (q>0)
12+
{
13+
r=q%10;
14+
s=s+r*r*r;
15+
q=q/10;
16+
}
17+
if (n==5)
18+
{
19+
printf("%d Is Armstrong",n);
20+
}
21+
else
22+
{
23+
printf("%d Is Not Armstrong",n);
24+
}
25+
getch();
26+
}

β€Ž1HM0.CPP

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
// Program to reverse a given number.
2+
#include<stdio.h>
3+
#include<conio.h>
4+
main()
5+
{
6+
int n,q,r,s;
7+
clrscr();
8+
printf("\nEnter An Integer= ");
9+
scanf("%d",&n);
10+
q=n;
11+
s=0;
12+
while (q>0)
13+
{
14+
r=q%10;
15+
s=s*10+r;
16+
q=q/10;
17+
}
18+
printf("\n%d Is Reversed As %d",n,s);
19+
getch();
20+
}
21+
22+

β€Ž1HM1.CPP

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
// Program to add numbers of a given integer.
2+
#include<stdio.h>
3+
#include<conio.h>
4+
main()
5+
{
6+
int n,q,r,s;
7+
clrscr();
8+
printf("\nEnter An Integer= ");
9+
scanf("%d",&n);
10+
q=n;
11+
s=0;
12+
while (q>0)
13+
{
14+
r=q%10;
15+
s=s+r;
16+
q=q/10;
17+
}
18+
printf("\nSum Of Digits Is= %d",s);
19+
getch();
20+
}
21+

β€Ž1HM2.CPP

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
// Program to make palindrome.
2+
#include<stdio.h>
3+
#include<conio.h>
4+
main()
5+
{
6+
int n,q,r,s;
7+
clrscr();
8+
printf("Enter An Integer= ");
9+
scanf("%d",&n);
10+
q=n;
11+
s=0;
12+
while (q>0)
13+
{
14+
r=q%10;
15+
s=s*10+r;
16+
q=q/10;
17+
}
18+
if (n==s)
19+
{
20+
printf("Given Number Is Palindrome");
21+
}
22+
else
23+
{
24+
printf("Given Number Is Not Palindrome");
25+
}
26+
getch();
27+
}
28+
29+

β€Ž1HM3.CPP

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
// Program to make palindrome.
2+
#include<stdio.h>
3+
#include<conio.h>
4+
main()
5+
{
6+
int n,q,r,s;
7+
clrscr();
8+
printf("Enter An Integer= ");
9+
scanf("%d",&n);
10+
q=n;
11+
s=0;
12+
while (q>0)
13+
{
14+
r=q%10;
15+
s=s*10+r;
16+
q=q/10;
17+
}
18+
if (n==s)
19+
{
20+
printf("Given Number Is Palindrome");
21+
}
22+
else
23+
{
24+
printf("Given Number Is Not Palindrome");
25+
}
26+
getch();
27+
}
28+
29+

β€Ž1HM4.CPP

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
// Program to do matrix multiplacation.
2+
#include<stdio.h>
3+
#include<conio.h>
4+
main()
5+
{
6+
int i,j,k,r1,c1,r2,c2;
7+
int a[10][10], b[10][10], c[10][10];
8+
clrscr();
9+
printf("Enter The Number Of Rows And Columns Of 1st Matrix:\n");
10+
scanf("%d %d",&r1,&c1);
11+
printf("\nEnter The Number Of Rows And Columns Of 2nd matrix:\n");
12+
scanf("%d %d",&r2,&c2);
13+
if (c1!=r2)
14+
{
15+
clrscr();
16+
printf("Invalid Entry.\nMultiplacation Is Not Possible.");
17+
goto ab;
18+
}
19+
printf("\nEnter The Elements Of 1st Matrix:\n");
20+
for (i=0;i<r1;i++)
21+
for (j=0;j<c1;j++)
22+
scanf("%d",&a[i][j]);
23+
printf("\nEnter The Elements Of 2nd Matrix:\n");
24+
for (i=0;i<r2;i++)
25+
for (j=0;j<c2;j++)
26+
scanf("%d",&b[i][j]);
27+
for (i=0;i<r1;i++)
28+
{
29+
for (j=0;j<c2;j++)
30+
{
31+
c[i][j]=0;
32+
for (k=0;k<r2;k++)
33+
{
34+
c[i][j]=c[i][j]+a[i][k]*b[k][j];
35+
}
36+
}
37+
}
38+
printf("\nThe Multiplacation Is:");
39+
for (i=0;i<r1;i++)
40+
{
41+
printf("\n");
42+
for (j=0;j<c2;j++)
43+
{
44+
printf("%3d",c[i][j]);
45+
}
46+
}
47+
ab:
48+
getch();
49+
}
50+
51+

β€Ž1HM5.CPP

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
// Program to count negative elements form the list.
2+
#include<stdio.h>
3+
#include<conio.h>
4+
main()
5+
{
6+
int a[10],i,c,n;
7+
clrscr();
8+
printf("\nEnter The Number Of Numbers: ");
9+
scanf("%d",&n);
10+
printf("\nEnter The Elements:\n");
11+
for (i=1;i<=n;i++)
12+
{
13+
scanf("%d",&a[i]);
14+
}
15+
c=0;
16+
for (i=1;i<=n;i++)
17+
{
18+
if (a[i]<0)
19+
{
20+
c=c+1;
21+
}
22+
}
23+
printf("\nNumber Of Negative Elements Are: %d",c);
24+
getche();
25+
}

β€Ž1HM6.CPP

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
// Program to do transpose of a matrix.
2+
#include<stdio.h>
3+
#include<conio.h>
4+
main()
5+
{
6+
int a[4][4], b[4][4], i,j,m,n;
7+
clrscr();
8+
printf("Enter The Order Of Matrix (a*b):\n");
9+
scanf("%d %d",&m,&n);
10+
printf("\nEnter Elements Of Matrix:\n");
11+
for (i=1;i<=m;i++)
12+
for (j=1;j<=n;j++)
13+
scanf("%d",&a[i][j]);
14+
for (i=1;i<=m;i++)
15+
for (j=1;j<=n;j++)
16+
b[i][j]=a[j][i];
17+
printf("\nTranspose Of Obtained Matrix Is:\n");
18+
for (i=1;i<=m;i++)
19+
{
20+
for (j=1;j<=n;j++)
21+
{
22+
printf("%d\t",b[i][j]);
23+
}
24+
printf("\n");
25+
}
26+
getch();
27+
}

β€Ž1HM7.CPP

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
// Program to add a matrix using array method.
2+
#include<stdio.h>
3+
#include<conio.h>
4+
main()
5+
{
6+
int a[4][4], b[4][4], sum[4][4], i,j;
7+
clrscr();
8+
printf("Enter The Elements Of 1st Matrix:\n");
9+
for (i=1;i<=2;i++)
10+
for (j=1;j<=2;j++)
11+
scanf("%d",&a[i][j]);
12+
printf("\nEnter The Elements Of 2nd Matrix:\n");
13+
for (i=1;i<=2;i++)
14+
for (j=1;j<=2;j++)
15+
scanf("%d",&b[i][j]);
16+
for (i=1;i<=2;i++)
17+
for (j=1;j<=2;j++)
18+
sum[i][j]=a[i][j]+b[i][j];
19+
printf("\nMatrix Addition Is:\n");
20+
for (i=1;i<=2;i++)
21+
{
22+
for (j=1;j<=2;j++)
23+
printf("%d\t",sum[i][j]);
24+
}
25+
getch();
26+
}

0 commit comments

Comments
Β (0)