Social Icons

Pages

C programe to find simple and compound interest

#include<stdio.h>
#include<conio.h>
#include<math.h>

void main()
{
    float p,q,r,SI,CI;
    int n;
    clrscr();
   
    printf("Enter the value of Principal p = ");
    scanf("%f \n",&p);
    printf("Enter the value of Rate r = ");
    scanf("%f \n",&r);
    printf("Enter the value of Period n = ");
    scanf("%d \n",&n);
   
    SI = (p*r*n)/100;

    printf("Simple Interest SI=%f \n",SI);
   
    q = 1+(r/100);
    CI=p*pow(q,n);
   
    printf("Compound Interest CI=%f \n",CI);
   
    getch();
}

Hill Cipher Algorithm Program in C

#include<stdio.h>
#include<conio.h>
void main()
{
int i,j,ans[25][1],sum=0,mtrx[25][25],end;
char txt[25];
clrscr();
printf("\nEnter the string : ");
scanf("%s",txt);
//clrscr();
for(i=0;i<25;i++)
{
if(txt[i]>=97 && txt[i]<122) {}
else
{
end=i;
break;
}
}
for(i=0;i<end;i++)
{
//printf("initial : %d ",txt[i]);
txt[i]=txt[i]-'a';
//printf("final : %d ",txt[i]);
//printf("\n\n");
}
clrscr();
printf("\nEnter matrix...\n");
for(i=0;i<end;i++)
{
for(j=0;j<end;j++)
{
scanf("%d",&mtrx[i][j]);
}
}
for(i=0;i<end;i++)
{
sum=0;
for(j=0;j<end;j++)
{
sum+=mtrx[i][j]*(int)txt[j];
}
ans[i][0]=sum;
}
for(i=0;i<end;i++)
{
printf(" %c",((ans[i][0])%26)+97);
}
getch();
}

Convert Celsius to Fahrenheit








Insert a number into one of the input fields below:

degrees Celsius

equals

degrees Fahrenheit

Note that the Math.round() method is used, so that the result will be returned as an integer.




Click To Know Today's Day





Click the button to display todays day of the week.








How to Display Current Date & Time

<!DOCTYPE html>
<html>
<head>
<script>
function displayDate()
{
document.getElementById("demo").innerHTML=Date();
}
</script>
</head>
<body>

<h1>
Today's date is</h1>
<p id="demo">
</p>

<button type="button" onclick="displayDate()">Display Date</button>

</body>
</html>

How to display Current Date & Time








Today's date is






How to remove the default text in textbox when clicked on it

<html><head><title>(Type a title for your page here)</title>

  <script type="text/javascript">
  function make_blank()
  {
  document.form1.type.value ="";
  }
  </script>

  </head>
  <body >

  <form name=form1 method=post action='test.php'>
  <input type=text name=type value='Enter your user id' onClick="make_blank();"></form>

  </body>
  </html>