Social Icons

Pages

Featured Posts

C Program to print the series


12345
2345
345
45
5

#include <stdio.h>
#include<conio.h>
void main()
{
    int i, j;
  clrscr();
    for(i=1;i<=5;i++)
    {
        for(j=i;j<=5;j++)
        {
            printf("%d",j);
        }
        printf("\n");
    }

    getch();
}

C Program TO Print the Folliwing Series Using Loop

12345
1234
123
12
1

#include <stdio.h>

void main()
{
    int i, j;
    for(i=5;i>=1;i--)
    {
        for(j=1;j<=i;j++)
        {
            printf("%d",j);
        }
        printf("\n");
    }

    getch();
}

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>