Skip to content

Commit

Permalink
Merge pull request #92 from Chaitali3005/Chaitali
Browse files Browse the repository at this point in the history
Added Basic C program
  • Loading branch information
aman-raza authored Oct 10, 2020
2 parents 92614d3 + 98f7ac4 commit a3f77aa
Show file tree
Hide file tree
Showing 3 changed files with 93 additions and 0 deletions.
25 changes: 25 additions & 0 deletions ALPHABET.C
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#include<stdio.h>
#include<conio.h>

void main()
{
char c;

clrscr();

printf("Enter the Character:");
scanf("%c",&c);

if((c>='a'&& c<='z') || (c>='A'&& c<='Z'))
{
printf("It is an Alphabet.");
}

else
{
printf("It is not an Alphabet.");
}

getch();

}
25 changes: 25 additions & 0 deletions COMPOUND.C
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#include<stdio.h>
#include<conio.h>
#include<math.h>
void main()
{
float p,r,t,i,n;

clrscr();

printf("Enter the Principal Amount:");
scanf("%f",&p);
printf("Enter the Rate of Interest:");
scanf("%f",&r);
printf("Enter the Time Period:");
scanf("%f",&t);


i=p*(pow(1+r/100,t));

printf("The Compound Interest is %.2f.",i);

getch();

}

43 changes: 43 additions & 0 deletions NSTRONG.C
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
#include<stdio.h>
#include<conio.h>
void main()
{
int i,n,fact=1,temp,rem,sum=0;

clrscr();

printf("Enter limit n:");
scanf("%d",&n);
printf("The Strong Numbers Between 1 to %d are:\n",n);

i=1;

while(i<=n)
{
temp=i;
sum=0;
while(temp>0)
{
rem=temp%10;
fact=1;

while(rem>0)
{
fact=fact*rem;
rem--;
}
sum=sum+fact;
temp=temp/10;
}
if(sum==i)
{
printf("%d\t",i);
}



i++;
}

getch();
}

0 comments on commit a3f77aa

Please sign in to comment.