1. Simple Interest and compound interest:
/***************** Prg 1. ***************/
#include
#include
#include
void main()
{
   clrscr();
   printf("Prg. to find the Simple Interest & Compoun Interest\n");
   printf("\n S.I = (p*t*r)/100 \t C.I = (p*(1+r/100)pow t\n");
   int p,t,r;
   float avgSI=0, avgCI=0;
//    float temp=4/10;
   printf("\nEnter Principal : ");
   scanf("%d",&p);
   printf("\nEnter Time : ");
   scanf("%d",&t);
   printf("\nEnter Rate : ");
   scanf("%d", &r);
//    printf("%f",pow(4,2));
   avgSI=((p*t*r)/100);
   avgCI=(p*pow((1+(r/100)),t));
   printf("\n S.I : %f",avgSI);
   printf("\n C.I : %f",avgCI);
//    printf("\n%f",temp);
   getch();
}
---------------------------------------------------------
2. Calculating income Tax:
/************** Prg 2. **************/
#include
#include
void main()
{
   clrscr();
   printf("Prg. to cal. income tax\n");
   printf("\n First US$ 5000 of income :0% tax");
   printf("\n Next US$ 10,000 of income :10%");
   printf("\n Next US$ 20,000 of income :15%");
   printf("\n An amount above US$ 35,000 :20%");
   printf("\nPlease enter the total amount to cal. income tax : ");
   float intTotalAmt;
   float fltCarryon=0, fltC1=0,fltC2=0, fltC3=0, fltTot=0;
   float intdummy=0, intdummy1=0, intdummy2=0, intdummy3=0;
   scanf("%f",&intTotalAmt);
   if (intTotalAmt>5000)
   {
         intdummy=intTotalAmt-5000;
         if (intdummy>=10000)
         {
       intdummy1=intdummy-10000;
       fltCarryon=10000*.10;
       //printf("%d",intdummy1);
         }
         else
         {
       fltTot=intdummy*.10;
         }
         if (intdummy1>=20000)
         {
       intdummy2=intdummy1-20000;
       fltC1=20000*.15;
         }
         else
         {
       fltTot=fltTot + (intdummy1*.15);
         }
         if (intdummy2>=35000)
         {
       intdummy3=intdummy2-35000;
       fltC2=35000*.20;
         }
         else
         {
       fltTot=fltTot + (intdummy2*.20);
         }
          //printf("%f",fltTot);
          fltTot=fltTot+fltCarryon+fltC1+fltC2;
          printf("%f",fltTot);
   }
   else
   {
       printf("\nTax will be dec. if the amt exceeds 5000");
   }
   getch();
}
---------------------------------------------------------------------------
3. Finding Odd and Even numbers:
/********************** Prg 3  **********************/
#include
#include
void main()
{
   clrscr();
   int i;
   int intEven=0,intOdd=0;
   int sumEven=0,sumOdd=0;
   float avgEven=0, avgOdd=0;
   printf("Please enter the number other than 0\n");
   do
   {
       scanf("%d",&i);
       if (i%2==0)
       {       if(i>1)
           intEven++;
           sumEven=sumEven+i;
       }
       else
       {
           intOdd++;
           sumOdd=sumOdd+i;
       }
   }while(i!=0);
   printf("\nTotal Even Num. : %d",intEven);
   printf("\nTotal Odd Num. : %d",intOdd);
   avgEven=sumEven/intEven;
   avgOdd=sumOdd/intOdd;
   printf("\n Avg of Even : %f",avgEven);
   printf("\n Avg of Odd : %f",avgOdd);
          getch();
}
---------------------------------------------------------------------------------
4. Generate the divisors of a given integer:
/**************************** Prg. 4  ***********************/
#include
#include
void main()
{
   clrscr();
   printf("Prg. to find the divisors of interger ");
   int i;
   printf("\n Please enter the Num. to find : ");
   scanf("%d",&i);
   if (i>1)
   {
       for(int j=1; j<=i;j++)         {             if (i%j==0)                    {                     printf("\n%d",j);                 }         }     }     else     {         printf("Entered number should be greater then 1");     }     getch(); }  ------------------------------------------------------------------------------  5. Armstrong Number:  /*************** Prg. 5 **********************/     #include
 #include
 void main()
 {
   clrscr();
   printf("\n Prg to find Amstrong b/w 0 and 999\n");
   int i;
   int temp=0, temp1=0;
   int sum=0;
   for(i=0;i<=999;i++)     {        temp=i;        sum=0;        temp1=0;        while (temp>0)
      {
       temp1=temp%10;
       temp=temp/10;
       sum=sum+(temp1*temp1*temp1);
      }
      if (i==sum)
       printf("\n%d",sum);
   }
   getch();
 }
---------------------------------------------------------------------------
6. Perfect Number:
/*********************** Prg. 6 ************************/
/
 #include
 #include
 void main()
 {
   clrscr();
   printf("\n Prg. to find entered number is perfect number or not\n");
   int i;
   int sum=0;
   scanf("%d",&i);
   int temp=i;
       for(int j=1; j
 #include
 void main()
 {
   clrscr();
   printf("\nPrg. to Find Amicable Number\n");
   printf("\nPlease enter 2 numbers\n");
   printf("No. 1: ");
   int num1, num2;
   int sum=0, sum1=0;
   scanf("%d", &num1);
   printf("\nNo. 2: ");
   scanf("%d", &num2);
          for(int j=1; j
 #include
 #include
 void main()
 {
   clrscr();
   printf("\n Prg. to find roots of quadratic equation\n");
   printf("\n b+-sqrt(4*a*c)/2a\n");
   int a,b,c;
   float avg1=0,avg2=0,finalResult=0;
   printf("\nNo. 1: ");
   scanf("%d",&a);
   printf("\nNo. 2: ");
   scanf("%d",&b);
   printf("\nNo. 3: ");
   scanf("%d",&c);
    avg1=(b+(4*a*c));
//     printf("%f",avg1);
    avg2=(b-(4*a*c));
//     printf("%f",avg2);
   finalResult=(avg1+(avg2))/(2*a);
   printf("\n%f",finalResult);
   //printf("%f",sqrt(a));
   getch();
 }
-------------------------------------------------------------------------