7341135856
CODE WITH {SHIVAY}
All source codes are available
Get in Touch
Source codes
EASY STUDY
Hey,friends this website is the original site of easy study. You can easily get all the source codes from this website
source codes{/}
PROJECT TO MAKE CALENDER IN #C
#include<stdio.h>
#include<stdlib.h>
int get_1st_weekday(int y);
void main()
{
system("color 4F");
int year,i,j,n,a,weekday=0,startingday;
printf("\n ENTER THE DESIRED YEAR \n");
scanf("%d",&year);
printf("\n-------------------CALENDER BY SHIVAYA------------------------------\n");
char *months[]={"JANUARY","FABURARY","MARCH","APRIL","MAY","JUNE","JULY","AUGUST","SEPTEMBER","OCTOBER","NOVEMBER","DECEMBER"};
int monthdays[]={31,28,31,30,31,30,31,31,30,31,30,31};
if((year%4==0&&year%100!=0)||year%400==0)
monthdays[1]=29;
startingday=get_1st_weekday(year);
printf("\n THE CALENDER OF %d IS BELOW \n",year);
for(i=0;i<12;i++)
{
n=monthdays[i];
printf("\n--------------------%s------------------\n",months[i]);
printf("\n SUN MON TUE WED THURS FRI SAT \n");
for(weekday=0;weekday<startingday;weekday++)
printf(" ");
for(j=1;j<=n;j++)
{
printf("%5d",j);
if(++weekday>6)
{
printf("\n");
weekday=0;
}
startingday=weekday;
}
}
getch();
}
int get_1st_weekday(int y )
{
int d;
d=(((y-1)*365+(y-1)/4-(y-1)/100+(y/400)+1)%7 );
return d;
}
SOURCE CODE FOR DIGITAL CLOCK IN #C
/* Program to create a digital clock in C programming language */
#include<stdio.h>
#include<conio.h>
#include<stdlib.h>
#include<time.h>
void main()
{system("color 3F");
int h=0,m=0,s=0;
double i;
system("cls");
printf("\n ENTER THE TIME FORMAT IN HH:MM:SS \n");
scanf("\n%d%d%d",&h,&m,&s);
start:
for(h;h<24;h++)
{
for(m;m<60;m++)
{
for(s;s<60;s++)
{ system("color 1F");
system("cls");
for(i=1;i<=90;i++)
printf("-");
printf("\n\tDIGITAL CLOCK PROGRAMMED BY SHIVAY SHARMA \n");
printf("\n\n\n\t\t %d:%d:%d ",h,m,s);
if(h<12)
{
printf("AM");
}
else
{
printf("PM");
}
printf("\n\t\t\v 1 JANUARY 2021\n");
for(i=0;i<361999999;i++)
i++;
i--;
}s=0;
}m=0;
}h=0;
goto start;
getche();
}
HOW TO MAKE MULTIFUNCTIONAL CALCULATOR IN C#
BELOW IS A SOURCE CODE WHERE I HAD EXPLAINED HOW TO MAKE MULTIFUNCTIONAL CALCULATOR IN C
//MULTIFUNCTIONAL CALCULATOR
#include<stdio.h>
#include<conio.h>
#include<math.h>
#define PI 3.14
void mul();
void simple();
void alzebra();
void matrix();
void sub();
void trans();
void deter();
void trigno();
void add();
void table();
void main()
{
system("color 4F");
char a;
printf("\n------------- PROGRAMMED BY SHIVAYA ---------------\n");
printf("\n================================================================\n");
printf("\n MULTIFUNCTIONAL CALCULATOR \n");
printf("\n================================================================\n");
printf("\n PRESS 'S' FOR SIMPLE CALCULATOR \n");
printf("\n PRESS 'E' FOR ALZEBRIC CALCULATOR \n");
printf("\n PRESS 'M' FOR MATRIX CALCULATOR \n");
printf("\n PRESS 'T' FOR TRIGNOMETRIC CALCULATOR \n");
printf("\n PRESS 'P' FOR MULTIPLICATIN TABLE OF ANY NUMBER \n");
scanf("%c",&a);
switch(a)
{
case 'S':
simple();
break;
case 'E':
alzebra();
break;
case 'M':
matrix();
break;
case 'T':
trigno();
break;
case 'P':
table();
break;
default:
printf("\n YOUR CHOICE IS INNCORRECT \n");
break;
}
}
void simple()
{
system("color 5F");
system("cls");
printf("\n===========================================\n");
printf("\n SIMPLE CALCULATOR=======\n");
printf("\n===========================================\n");
float n1,n2;
char op;
float result;
printf("\n ENTER THE FIRST NUMBER \n");
scanf("%f",&n1);
printf("\n ENTER THE SECOND NUMBER \n");
scanf("%f",&n2);
printf("\n SELECT THE OPERATER '+','-','*','/' FOR CALCULATION \n");
scanf("\n%c",&op);
switch(op)
{
case '+':
result=n1+n2;
printf("\n ADDITION=%f \n",result);
break;
case '-':
result=n1-n2;
printf("\n SUBTRACTION=%f \n",result);
break;
case '*':
result=n1*n2;
printf("\n PRODUCT=%f \n",result);
break;
case '/':
result=n1/n2;
printf("\n DIVISION=%f \n",result);
break;
default:
printf("\n PLEASE SELECT THE CORRECT OPPERATER \n");
break;
printf("\n PRESS ANY KEY TO CONTINUE \n");
getch();
}
}
void alzebra()
{
system("color 7F");
system("cls");
float a,b,c,r;
char l;
printf("\n==============================================\n");
printf("\n ALZEBRIC CALCULATOR \n");
printf("\n==============================================\n");
printf("\n ENTER THE VALUE OF 'a'\n");
scanf("%f",&a);
printf("\n ENTER THE VALUE OF 'b'\n");
scanf("%f",&b);
printf("\n ENTER THE VALUE OF 'c' IF EXIST \n");
scanf("%f",&c);
printf("\n PRESS 1. FOR (a+b)whole square \n");
printf("\n PRESS 2. FOR (a-b)whole square \n");
printf("\n PRESS 3. FOR (a)square-(b)square \n");
printf("\n PRESS 4. FOR (a)square+(b)square \n");
printf("\n PRESS 5. FOR (a+b+c)whole square \n");
printf("\n PRESS 6. FOR (a-b-c)whole square \n");
printf("\n PRESS 7. FOR (a+b)whole cube \n");
printf("\n PRESS 8. FOR (a-b)whole cube \n");
printf("\n PRESS 9. FOR (a)cube-(b)cube \n");
printf("\n PRESS 10.FOR (a)cube+(b)cube \n");
scanf("\n%c",&l);
switch(l)
{
case '1':
system("color 3F");
system("cls");
r=a*a+b*b+2*a*b;
printf("\n WHOLE SQUARE OF (a+b) IS %f \n",r);
break;
case '2':
system("cls");
r=a*a-2*a*b+b*b;
printf("\n WHOLE SQUARE OF (a-b) is %f \n",r);
break;
case '3':
system("cls");
r=(a-b)*(a+b);
printf("\n (a)square-(b)square IS EQUEL TO %f \n",r);
break;
case '4':
system("cls");
r=(a*a)+(b*b)+(2*a*b)-2*a*b;
printf("\n (a)square+(b)square IS EQUEL TO %f \n",r);
break;
case '5':
system("cls");
r=(a*a)+(b*b)+(c*c)+(2*a*b)+(2*b*c)+(2*c*a);
printf("\n(a+b+c)whole square IS EQUEL TO %f \n",r);
break;
case '6':
system("cls");
r=(a*a)+(b*b)+(c*c)-(2*a*b)+(2*b*c)-(2*c*a);
printf("\n a-b-c whole square IS EQUEL TO %f \n",r);
break;
case '7':
system("cls");
r=(a*a*a)+3*(a*a*b)+3*a*b*b+(b*b*b);
printf("\n (a+b)whole cube IS EQUEL TO %f \n",r);
break;
case '8':
system("cls");
r=(a*a*a)-(b*b*b)-3*a*b*(a-b);
printf("\n (a-b)whole cube IS EQUEL TO %f \n",r);
break;
case '9':
system("cls");
r=(a-b)*(a*a)+a*b+(b*b);
printf("\n a(cube)-b(cube) IS EQUEL TO %f \n",r);
break;
case 'T':
system("cls");
r=(a+b)*(a*a)-(a*b)+(b*b);
break;
default:
printf("\n YOUR CHOICE IS INNCORRECT \n");
break;
printf("\n PRESS ANY KEY TO CONTINUE \n");
getch();
}
}
void matrix()
{
system("color CF");
system("cls");
int i,j,n,m,p,q;
char choice;
printf("\n==============================================\n");
printf("\n MATRIX CALCULATOR \n");
printf("\n==============================================\n");
printf("\n PRESS '+' FOR MATRIX ADDITION \n");
printf("\n PRESS '-' FOR MATRIX SUBTRACTION \n");
printf("\n PRESS '*' FOR MATRIX MULTIPLICTION \n");
printf("\n PRESS 'T' FOR TRANSPOSE FIRST MATRIX \n");
printf("\n PRESS 'D' TO FIND THE DETERMINENT OF MATRIX \n");
scanf("\n%c",&choice);
switch(choice)
{
system("cls");
case '+':
add();
break;
case '-':
sub();
break;
case '*':
mul();
break;
case 'T':
trans();
break;
case 'D':
deter();
break;
default:
printf("\n YOUR CHOICE IS INNCORRECT \n");
break;
printf("\n PRESS ANY KEY TO CONTINUE \n");
getch();
}
}
void add()
{ system("color 9F");
int a[10][10],b[10][10],c[10][10];
int i,j;
printf("\n ENTER THE ELEMENTS OF FIRST MATRIX \n");
for(i=0;i<=2;i++)
{
for(j=0;j<=2;j++)
{
scanf("%d",&a[i][j]);
}
}
printf("\n ENTER THE ELEMENTS OF SECOND MATRIX \n");
for(i=0;i<=2;i++)
{
for(j=0;j<=2;j++)
{
scanf("%d",&b[i][j]);
}
}
printf("\n THE SUM OF TWO MATRIX IS :");
for(i=0;i<=2;i++)
{
for(j=0;j<=2;j++)
{
c[i][j]=a[i][j]+b[i][j];
printf(" %d",c[i][j]);
}
printf("\n");
}
}
void sub()
{ system("color EF");
int a[10][10],b[10][10],c[10][10];
int i,j;
printf("\n ENTER THE ELEMENTS OF FIRST MATRIX \n");
for(i=0;i<=2;i++)
{
for(j=0;j<=2;j++)
{
scanf("%d",&a[i][j]);
}
}
printf("\n ENTER THE ELEMENTS OF SECOND MATRIX \n");
for(i=0;i<=2;i++)
{
for(j=0;j<=2;j++)
{
scanf("%d",&b[i][j]);
}
}
printf("\n THE SUBTRACTION OF TWO MATRIX IS :\n");
for(i=0;i<=2;i++)
{
for(j=0;j<=2;j++)
{
c[i][j]=a[i][j]-b[i][j];
printf(" %d ",c[i][j]);
}
printf("\n");
}
}
void mul()
{
system("color 3F");
int i,j,k,sum;
int a[10][10],b[10][10],c[10][10];
printf("\n ENTER THE ELEMENTS OF FIRST MATRIX \n");
for(i=0;i<=2;i++)
{
for(j=0;j<=2;j++)
{
scanf("%d",&a[i][j]);
}
}
printf("\n ENTER THE ELEMENTS OF SECOND MATRIX \n");
for(i=0;i<=2;i++)
{
for(j=0;j<=2;j++)
{
scanf("%d",&b[i][j]);
}
}
printf("\n THE PRODUCT OF TWO MATRIX IS :");
for(i=0;i<=2;i++)
{
for(j=0;j<=2;j++)
{
sum=0;
for(k=0;k<=2;k++)
sum=sum+a[i][k]*b[k][j];
c[i][j]=sum;
}
}
printf("\n THE PRODUCT OF TWO MATRIX IS: \n");
for(i=0;i<=2;i++)
{
for(j=0;j<=2;j++)
{
printf(" %d ",c[i][j]);
}
printf("\n");
}
printf("\n PRESS ANY KEY TO CONTINUE \n");
getch();
}
void trans()
{
system("color 0F");
int a[10][10],c[10][10];
int i,j;
printf("\n ENTER THE ELEMENTS OF THE MATRIX \n");
for(i=0;i<=2;i++)
{
for(j=0;j<=2;j++)
{
scanf("%d",&a[i][j]);
}
}
printf("\n THE TRANSPOSE OF THE MATRIX IS : \n");
for(i=0;i<=2;i++)
{
for(j=0;j<=2;j++)
{
c[i][j]=a[j][i];
}
}
for(i=0;i<=2;i++)
{
for(j=0;j<=2;j++)
{
printf("%d ",c[i][j]);
}
printf("\n");
}
printf("\n PRESS ANY KEY TO CONTINUE \n");
getch();
}
void deter()
{
system("color 1F");
int a[10][10],det,i,j;
printf("\nENTER THE DIFFERENT ELEMENTS OF THE MATRIX \n");
for(i=0;i<=2;i++)
{
for(j=0;j<=2;j++)
{
scanf("%d",&a[i][j]);
}
}
printf("\n YOUR MATRIX IS : \n");
for(i=0;i<=2;i++)
{
for(j=0;j<=2;j++)
{
printf(" %d ",a[i][j]);
}
printf("\n");
}
det=(a[0][0]*(a[1][1]*a[2][2]-a[2][1]*a[1][2])-a[0][1]*(a[1][0]*a[2][2]-a[2][0]*a[1][2])+a[0][2]*(a[1][0]*a[2][1]-a[2][0]*a[1][1]));
printf("\n THE DETERMINENT IS %d \n",det);
printf("\n PRESS ANY KEY TO CONTINUE \n");
getch();
}
void trigno()
{
system("color 4F");
system("cls");
char ch;
double a,b,c;
printf("\n PRESS 'S'TO CALCULATE sin \n");
printf("\n PRESS 'C'TO CALCULATE cos \n");
printf("\n PRESS 'T'TO CALCULATE tan \n");
printf("\n PRESS 'E'TO CALCULATE cosecent \n");
printf("\n PRESS 'F'TO CALCULATE secent \n");
printf("\n PRESS 'O'TO CALCULATE cot \n");
scanf("\n%c",&ch);
if(ch=='S')
{
printf("\n ENTER THE ANGLE i.e. VALUE OF ANGLE \n");
scanf("\n%lf",&a);
b=(PI/180)*a;
c=sin(b);
printf("\n THE VALUE OF sin%lf IS %lf \n",a,c);
printf("\n PRESS ANY KEY TO CONTINUE \n");
getch();
}
else if(ch=='C')
{
printf("\n ENTER THE ANGLE i.e. VALUE OF ANGLE \n");
scanf("\n%lf",&a);
b=(PI/180)*a;
c=cos(b);
printf("\n THE VALUE OF cos%lf IS %lf \n",a,c);
printf("\n PRESS ANY KEY TO CONTINUE \n");
getch();
}
else if(ch=='T')
{
printf("\n ENTER THE ANGLE i.e. VALUE OF ANGLE \n");
scanf("\n%lf",&a);
b=(PI/180)*a;
c=tan(b);
printf("\n THE VALUE OF tan%lf IS %lf \n",a,c);
printf("\n PRESS ANY KEY TO CONTINUE \n");
getch();
}
else if(ch=='E')
{
printf("\n ENTER THE ANGLE i.e. VALUE OF ANGLE \n");
scanf("\n%lf",&a);
b=(PI/180)*a;
c=sinh(b);
printf("\n THE VALUE OF cosecent%lf IS %lf \n",a,c);
printf("\n PRESS ANY KEY TO CONTINUE \n");
getch();
}
else if(ch=='F')
{
printf("\n ENTER THE ANGLE i.e. VALUE OF ANGLE \n");
scanf("\n%lf",&a);
b=(PI/180)*a;
c=cosh(b);
printf("\n THE VALUE OF secent%lf IS %lf \n",a,c);
printf("\n PRESS ANY KEY TO CONTINUE \n");
getch();
}
else if(ch=='O')
{
printf("\n ENTER THE ANGLE i.e. VALUE OF ANGLE \n");
scanf("\n%lf",&a);
b=(PI/180)*a;
c=tanh(b);
printf("\n THE VALUE OF sin%lf IS %lf \n",a,c);
printf("\n PRESS ANY KEY TO CONTINUE \n");
getch();
}
}
void table()
{
system("cls");
system("color 9F");
int n,i,m;
printf("\n ENTER THE NUMBER ,FOR WHICH YOU WANT ITS MULTIPLICATION TABLE OF \n");
scanf("%d",&n);
printf("\n ENTER THE RANGE OF YOUR MULTIPLICATION TABLE \n");
scanf("%d",&m);
for(i=1;i<=m;i++)
{
printf("\n%dx%d=%d\n",i,n,i*n);
}
printf("\n PRESS ANY KEY TO CONTINUE \n");
getch();
}