Thursday, 27 May 2021

C problems

 

#include<stdio.h>
void main()
{
int y;
float n;
y=30.20;
n=50;
printf("answer is %d\t%f",y,n);


}

2.)
#include<stdio.h>
void main()
{

int pq ;
printf ( "Enter values of p and q" ) ;
scanf ( " %d %d "pq ) ;
printf ( "p = %d q =%d"pq ) ;




}

3.)
//write a program to find the expotential value of any number
//author:upendra
#include<stdio.h>
#include<math.h>
void main()
{
int a;
float expo_a;
printf("Enter the number to find the expotential of a :\n");
scanf("%d",&a);
expo_a=exp(a);

printf("expotential of e raise to a is %f",expo_a);



}

4.)
#include <stdio.h>
#include <stdlib.h>
#include<math.h>
int main()
float n,i,j,t,s;
printf("Enter the size of fish\n");
scanf("%f",&n);
n=n+14;
s=n/10;
t=4.72/n;
for(j=floor(s);j>=-ceil(s);j--){
for(i=0;i<=4;i=i+t){
if((j<s/2 && j>s/4 && i<1 && i>0.8||j==0 && i<0.6)||(pow(j/s,2)>=pow(sin(i),2))){
        printf(" ");
    }
else {
    printf("*");
}
}
printf("\n");
}
return 0;
}

5.)
#include<stdio.h>
#include<stdlib.h>
void main()
{
int x,y,N=20;
for(y=0;y<=20;y++)
{
for(x=0;x<=20;x++)
{
if(((x-10)*(x-10)/54 +(y-10)*(y-10)/25<=1)||((x-25)*(x-25)/54+(y-10)*(y-10)/25<=1))
{
printf("*");
}
else
{
printf(" ");
}
}

printf("\n");

}
}

6.)
//write a program to find sum of five digits number
//author :upendra yadav date:10/28/2020
#include<stdio.h>
void main()
{
int N,sum=0,rem,sum1,sum_avg,X//X is a variable to stored five digits number
printf("Enter the five digits number:\n");
scanf("%d",&N);
while(N!=0)
{
    sum1=N%10;
    rem=sum+sum1;
    X=N/10;
    sum_avg=rem+X;







}

printf("Sum of digits is %d ",sum_avg);






}

7.)
#include<stdio.h>
void first();
void second();
void third();
void four();
void five();
void main()
{
printf("Hello to the no world\n");
first();


}
void first()
{
printf("welcome to home to first person\n");
five();

}
void five()
{
printf("Welcome Home fiveth\n");
four();


}
void four()
{
printf("Welcome bro four\n");
second();



}
void second()
{
printf("Holi hai bro second\n ");
third();
}
void third()
{
printf("Welcome to last fuctions\n");

}

6.)
#include<stdio.h>
float subt(float,float);
void main()
{
float x,y,sub;
printf("enter the two values:");
scanf("%f%f",&x,&y);
sub=subt(x,y);
printf("answer is %f",sub);

}
float subt(float a,float b)
{
float ans;
ans=a-b;
return ans;
}

7.)
//write a program to for just fun
// author:upendra yadav
#include<stdio.h>
void main()
{
int num; // num- is any number you enter
printf("Enter any number:\n");
scanf("%d",&num);
printf("Yours secret number is %d",num);




}

8.)
#include<stdio.h>
void home();
void main()
{
printf("Hello buddy\n");
home();

}
void home()
{
printf("Welcome to Home");
}

9.)
// write a program for basic geometry of
//rectangle and circle
//author:upendra yadav date:10/27/2020
#include<stdio.h>
void main()
{
int lg,bd,rd,area_rec,area_cir,peri_rec;
float circum_cir;
printf("Enter the length and breath of a rectangle:\n");
printf("Enter the radius of a circle:\n");
scanf("%d%d%d",&lg,&bd,&rd);
area_rec=lg*bd;
peri_rec=2*lg+2*bd;
area_cir=rd*rd;
circum_cir=2*3.14*rd;
// answer is given below
printf("Area of Rectangle is %d\n",area_rec);
printf("Perimeter of a Rectangle is %d\n",peri_rec);
printf("Area of a Circle is %d\n",area_cir);
printf("Circumference of a Circle is %2f\n",circum_cir);









}

10.)
/* goto keyword is used
*/
#include<stdio.h>

void main()
{
 int i=1;

 if(i==1)
  goto one;
 else if(i==2)
  printf("2");
 else
  printf("Its nothing");

 one:
 printf("Avoid goto keyword");
}


11.)
//write a program to find the grade of a individual
//author:upendra
#include<stdio.h>
void main()
{
int grade,Result;
printf("Enter the grade of a student:\n");
scanf("%d",grade);
Result=(grade>=35)?pass:fail;
printf("result is %d",Result);



}


12.)
//write a program to find the grade of person
//author:upendra
#include<stdio.h>
void main()
{
int grade;
printf("Enter the grade of student:\n");
scanf("%d",&grade);
printf("%s\n",grade>=35?"pass":"fail");


}

13.)
// write a rogram using not operator
//author:upendra date:10/29/2020
#include<stdio.h>
void main()
{

int y;
printf("Enter the Input in terms of y:\n");
scanf("%d",&y);
if(y<=7)
printf("Yo upendra whats happen@@");
else
{
printf("Invalid Input");
}






}

14.)
#include<stdio.h>
void main()
{
int q;
for(q=0;q<=0;q--)
printf("system is hacked %d\t",q);


}

15.)
#include<stdio.h>
#include<conio.h>
#include<string.h>
#include<process.h>
#include<dos.h>
int i,j,k,l;
char ha[20][20] = {'H','A','P','P','Y',' ','B','I','R','T','H','D','A','Y'}, you[100];
void main()
{
int coun = 1, n;
char r[200], r1[200];

printf("Enter your friend's name to wish ");
gets(you);

do
{
printf("  \n\n\t\t\tBirthday Wishes Platform");
printf("\n\n\t\t\t 1.Box Wishes");
printf("\n\t\t\t 2.Hide and Seek Wishes");
printf("\n\t\t\t 3.Journey to Wish");
printf("\n\t\t\t 4.Smiley Wishes");
printf("\n\t\t\t 5.FLASH NEWS");
printf("\n\t\t\t Press any key other than 1-5 to exit");
printf("\nToday is Your Birthday so Choose what you like to choose %s:",coun==1?"First":coun==2?"Second":coun==3?"Third":coun==4?"Fourth":coun==5?"Fifth":coun==6?"Sixth":"");
scanf("%d",&n);
coun++;
if(n>7||n<=0)
exit(0);
switch(n)
{
case 1:
show1();
break;
case 2:
show2();
break;
case 3:
show3();
break;
case 4:
show4();
break;
case 5:
show5();
break;
default:
exit(0);
}
}while(n>0||n<=7);
getche();
}
show1()
{
for(i=5;i>0;i--)
{

printf("\n\n\n\n\t\t\tBox will Appears within %ds",i);
sleep(1);
}
clrscr();
printf("\t");
for(i=0;i<1;i++)
{
for(j=0;j<14;j++)
{
printf("%4c",ha[i][j]);
}
}
printf("\n\t\t\t");
for(i=0;i<1;i++)
{
for(j=0;j<14;j++)
{
sleep(1);
if(j==5)
{
sleep(2);
printf("\n\t\t\t  HAPPY BIRTHDAY FRIEND\n\t\t\t\t %s", you);
continue;
}
printf("\n%10c\t\t\t\t\t\t\t%c",ha[i][j],ha[i][j]);
}
}
printf("\n\t\tGOD BLESS YOU & ALL YOUR DESIRES COMES TRUE");
sleep(4);
clrscr();
return 0;
}
show2()
{
clrscr();
for(i=5;i>0;i--)
{
clrscr();
printf("\n\n\n\n\t\t\tHide & Seek Starts in %ds",i);
sleep(1);
}
clrscr();
sleep(1);
printf("\n HH   HH");
printf("\n HHHHHHH");
printf("\n HH   HH");
sleep(1);
clrscr();
printf("\n%20s","AAAAAAA");
printf("\n%20s","AA   AA");
printf("\n%20s","AAAAAAA");
printf("\n%20s","AA   AA");
sleep(1);
clrscr();
printf("\n");
printf("\n%50s","PPPPPPP");
printf("\n%50s","PP     PP");
printf("\n%50s","PP     PP");
printf("\n%50s","PPPPPPPPP");
printf("\n%50s","PP       ");
printf("\n%50s","PP       ");
sleep(1);
clrscr();
printf("\n\n");
printf("\n%30s","PPPPPPP");
printf("\n%30s","PP     PP");
printf("\n%30s","PP     PP");
printf("\n%30s","PPPPPPPPP");
printf("\n%30s","PP       ");
printf("\n%30s","PP       ");
sleep(1);
clrscr();
printf("\n\n\n\n\n\n\n");
printf("\n\t\tYY     YY");
printf("\n\t\t YY   YY");
printf("\n\t\t  YY YY ");
printf("\n\t\t    Y   ");
printf("\n\t\t    Y   ");
sleep(1);
clrscr();
printf("\n\n\n");
printf("\n%60s","BBBBBBBBBB");
printf("\n%60s","BB      BB");
printf("\n%60s","BB      BB");
printf("\n%60s","BBBBBBBBBB");
printf("\n%60s","BB      BB");
printf("\n%60s","BB      BB");
printf("\n%60s","BBBBBBBBBB");
sleep(1);
clrscr();
printf("\n\n\n\n\n\n\n\n");
printf("\n%30s","   IIIIII");
printf("\n%30s","     II  ");
printf("\n%30s","     II  ");
printf("\n%30s","     II  ");
printf("\n%30s","   IIIIII");
sleep(1);
clrscr();
printf("\n\n");
printf("\n%20s","  RRRRRRR");
printf("\n%20s","  RR     RR");
printf("\n%20s","  RR     RR");
printf("\n%20s","  RRRRRRRRR");
printf("\n%20s","  RR RR    ");
printf("\n%20s","  RR   RR  ");
printf("\n%20s","  RR     RR");
sleep(1);
clrscr();
printf("\nTTTTTTTT");
printf("\n   TT   ");
printf("\n   TT   ");
printf("\n   TT   ");
sleep(1);
clrscr();
printf("\n");
printf("\n%10s"," HH   HH");
printf("\n%10s"," HHHHHHH");
printf("\n%10s"," HH   HH");
sleep(1);
clrscr();
printf("\n\n\n\n\n\n\n\n\n\n\n");
printf("\n%35s"," DDDDDDD");
printf("\n%35s","   DD    DD");
printf("\n%35s","   DD    DD");
printf("\n%35s","   DD    DD");
printf("\n%35s"," DDDDDDD");
sleep(1);
clrscr();
printf("\n");
printf("\n%80s","AAAAAAA");
printf("\n%80s","AA   AA");
printf("\n%80s","AAAAAAA");
printf("\n%80s","AA   AA");
sleep(1);
clrscr();
printf("\n\n\n\n\n\n\n");
printf("\n%10s","YY     YY");
printf("\n%10s"," YY   YY");
printf("\n%10s","  YY YY ");
printf("\n%10s","    Y   ");
printf("\n%10s","    Y   ");
sleep(1);
clrscr();
sleep(3);
clrscr();
printf("\n\n\n\n\n\n\n");
printf("\n%20s HAPPY BIRTHDAY %s", "", you);
printf("\n\n\n\n\n\n\n\n");
printf("%30s","My Hearty wishes to you Friend...  ");
sleep(4);
clrscr();
return 0;
}
show3()
{
for(i=5;i>0;i--)
{
clrscr();
printf("\n\n\n\n\t\t\tJourney Begins in %ds",i);
sleep(1);
}
clrscr();
printf("\n\t\t\t\tJourney to Wish a FRIEND");
printf("\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tTenkasi");
printf("                                                                          %c",25);
sleep(1);
printf("\t                                                                          %c",25);
sleep(1);
printf("\t                                                                    %s","ALANGULAM");
sleep(2);
printf("\t                                                                          %c",25);
sleep(1);
printf("\t                                                                          %c",186);
sleep(1);
printf("\t                                                                          %c",186);
sleep(1);
printf("\t                                                                          %c",186);
sleep(1);
printf("\t                                                                    %cR %c Y %c G",178,177,176);
sleep(3);
printf("\t                                                                        %c ",188);
sleep(1);
printf("\t                                                  TIRUNELVELI WELCOMES YOU");
sleep(2);
printf("\t                                                                       %c",25);
sleep(1);
printf("\t                                                                       %c",186);
sleep(1);
printf("\t                                                                       %c",186);
sleep(1);
printf("\t                                                                       %c",186);
sleep(1);
printf("\t                                                            %c%c%c%c%c%c%c%c%c%c%c",205,205,205,205,205,205,205,205,205,205,205,205,185);
sleep(2);
printf("\t                                                             PALYAMKOTTAI");
sleep(2);
printf("\t                                                          %c%c%c%c%c%c%c%c%c",201,205,205,205,205,205,205,205,205);
printf("\t                %c%c%cDR.SACOE%c%c%c%c%c%c%c%c%cKURUMBUR%c%c%c%c%c%c%c%cALWAR%c%c%c%c%c%cSeidunganallur",206,205,205,254,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205);
sleep(2);
clrscr();
printf("\t\t\t\tEEE DEPARTMENT");
sleep(1);
printf("\n\t\t\t%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c",196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196);
sleep(1);
printf("\n\t\t\t%c               %c\n\t\t\t%c               %c\n\t\t\t%c               %c\n\t\t\t%c               %c\n\t\t\t%cHAPPY BIRTHDAY %c\n\t\t\t%c     %s   %c\n\t\t\t%c               %c\n\t\t\t%c               %c",179,179,179,179,179,179,179,179,179,179,179,you,179,179,179,179,179);
sleep(1);
printf("\n\t\t\t%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c",196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,47);
sleep(4);
clrscr();
return 0;
}
show4()
{
clrscr();
for(i=5;i>0;i--)
{
clrscr();
printf("\n\n\n\n\t\t\tSmileys Appears in %ds",i);
sleep(1);
}
clrscr();
for(i=0;i<=381;i++)
printf(" %c%c",1,2);
k=0;

for(i=0;i<15;i++)
{
printf(" %c",ha[k][i]);
sleep(1);
}sleep(1);printf("%s",you);sleep(1);
printf(" \n\t\tEVERY MOMENT IN YOUR LIFE WOULD BE FILLED WITH HAPPINESS ");
for(i=0;i<=319;i++)
printf("%c %c",1,2);
sleep(2);
clrscr();
return 0;
}
show5()
{
clrscr();
for(i=0;i<5;i++)
printf("\n");
printf("\n%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c",196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196);
printf("\n%c               %c       May Everyday Bring Something New and Exciting For You.  %c               %c  May This Birthday Turn Out To Be As Amazing As You.  \n%c               %c    \n%c      PHOTO    %c    .\"\n%c  LOADING...   %c\n%c               %c\n%c               %c",179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179);
printf("\n%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c",196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196);
for(i=0;i<6;i++)
printf("\n");
for(i=0;i<78;i++)
printf("%c",196);
for(i=0;i<4;i++)
{
if(i==0)
{
printf("\t\t\t\t");
call();
for(j=0;j<4;j++)
{
for(k=0;k<11;k++)
{
printf("\b");
}
sleep(1);
call(j);
}
}
for(k=0;k<11;k++)
printf("\b");
if(i==1)
 printf("\t\t\tHAPPY BIRTHDAY %s",you);
sleep(1);
sleep(1);
if(i==2)
printf("\n\t\t\t         by");
sleep(1);
if(i==3)
printf("\n\t\t       Best Friend");
}
sleep(6);
clrscr();

return 0;
}
call(int j)
{
 if(j==0)
printf("     FLASH  NEWS");
 if(j==1)
 printf("     FRESH  NEWS");
 if(j==2)
 printf("     NEWS UPDATE");
return 0;
}
#include<stdio.h>
#include<conio.h>
#include<string.h>
#include<process.h>
#include<dos.h>
int i,j,k,l;
char ha[20][20] = {'H','A','P','P','Y',' ','B','I','R','T','H','D','A','Y'}, you[100];
void main()
{
int coun = 1, n;
char r[200], r1[200];

printf("Enter your friend's name to wish ");
gets(you);

do
{
printf("  \n\n\t\t\tBirthday Wishes Platform");
printf("\n\n\t\t\t 1.Box Wishes");
printf("\n\t\t\t 2.Hide and Seek Wishes");
printf("\n\t\t\t 3.Journey to Wish");
printf("\n\t\t\t 4.Smiley Wishes");
printf("\n\t\t\t 5.FLASH NEWS");
printf("\n\t\t\t Press any key other than 1-5 to exit");
printf("\nToday is Your Birthday so Choose what you like to choose %s:",coun==1?"First":coun==2?"Second":coun==3?"Third":coun==4?"Fourth":coun==5?"Fifth":coun==6?"Sixth":"");
scanf("%d",&n);
coun++;
if(n>7||n<=0)
exit(0);
switch(n)
{
case 1:
show1();
break;
case 2:
show2();
break;
case 3:
show3();
break;
case 4:
show4();
break;
case 5:
show5();
break;
default:
exit(0);
}
}while(n>0||n<=7);
getche();
}
show1()
{
for(i=5;i>0;i--)
{

printf("\n\n\n\n\t\t\tBox will Appears within %ds",i);
sleep(1);
}
clrscr();
printf("\t");
for(i=0;i<1;i++)
{
for(j=0;j<14;j++)
{
printf("%4c",ha[i][j]);
}
}
printf("\n\t\t\t");
for(i=0;i<1;i++)
{
for(j=0;j<14;j++)
{
sleep(1);
if(j==5)
{
sleep(2);
printf("\n\t\t\t  HAPPY BIRTHDAY FRIEND\n\t\t\t\t %s", you);
continue;
}
printf("\n%10c\t\t\t\t\t\t\t%c",ha[i][j],ha[i][j]);
}
}
printf("\n\t\tGOD BLESS YOU & ALL YOUR DESIRES COMES TRUE");
sleep(4);
clrscr();
return 0;
}
show2()
{
clrscr();
for(i=5;i>0;i--)
{
clrscr();
printf("\n\n\n\n\t\t\tHide & Seek Starts in %ds",i);
sleep(1);
}
clrscr();
sleep(1);
printf("\n HH   HH");
printf("\n HHHHHHH");
printf("\n HH   HH");
sleep(1);
clrscr();
printf("\n%20s","AAAAAAA");
printf("\n%20s","AA   AA");
printf("\n%20s","AAAAAAA");
printf("\n%20s","AA   AA");
sleep(1);
clrscr();
printf("\n");
printf("\n%50s","PPPPPPP");
printf("\n%50s","PP     PP");
printf("\n%50s","PP     PP");
printf("\n%50s","PPPPPPPPP");
printf("\n%50s","PP       ");
printf("\n%50s","PP       ");
sleep(1);
clrscr();
printf("\n\n");
printf("\n%30s","PPPPPPP");
printf("\n%30s","PP     PP");
printf("\n%30s","PP     PP");
printf("\n%30s","PPPPPPPPP");
printf("\n%30s","PP       ");
printf("\n%30s","PP       ");
sleep(1);
clrscr();
printf("\n\n\n\n\n\n\n");
printf("\n\t\tYY     YY");
printf("\n\t\t YY   YY");
printf("\n\t\t  YY YY ");
printf("\n\t\t    Y   ");
printf("\n\t\t    Y   ");
sleep(1);
clrscr();
printf("\n\n\n");
printf("\n%60s","BBBBBBBBBB");
printf("\n%60s","BB      BB");
printf("\n%60s","BB      BB");
printf("\n%60s","BBBBBBBBBB");
printf("\n%60s","BB      BB");
printf("\n%60s","BB      BB");
printf("\n%60s","BBBBBBBBBB");
sleep(1);
clrscr();
printf("\n\n\n\n\n\n\n\n");
printf("\n%30s","   IIIIII");
printf("\n%30s","     II  ");
printf("\n%30s","     II  ");
printf("\n%30s","     II  ");
printf("\n%30s","   IIIIII");
sleep(1);
clrscr();
printf("\n\n");
printf("\n%20s","  RRRRRRR");
printf("\n%20s","  RR     RR");
printf("\n%20s","  RR     RR");
printf("\n%20s","  RRRRRRRRR");
printf("\n%20s","  RR RR    ");
printf("\n%20s","  RR   RR  ");
printf("\n%20s","  RR     RR");
sleep(1);
clrscr();
printf("\nTTTTTTTT");
printf("\n   TT   ");
printf("\n   TT   ");
printf("\n   TT   ");
sleep(1);
clrscr();
printf("\n");
printf("\n%10s"," HH   HH");
printf("\n%10s"," HHHHHHH");
printf("\n%10s"," HH   HH");
sleep(1);
clrscr();
printf("\n\n\n\n\n\n\n\n\n\n\n");
printf("\n%35s"," DDDDDDD");
printf("\n%35s","   DD    DD");
printf("\n%35s","   DD    DD");
printf("\n%35s","   DD    DD");
printf("\n%35s"," DDDDDDD");
sleep(1);
clrscr();
printf("\n");
printf("\n%80s","AAAAAAA");
printf("\n%80s","AA   AA");
printf("\n%80s","AAAAAAA");
printf("\n%80s","AA   AA");
sleep(1);
clrscr();
printf("\n\n\n\n\n\n\n");
printf("\n%10s","YY     YY");
printf("\n%10s"," YY   YY");
printf("\n%10s","  YY YY ");
printf("\n%10s","    Y   ");
printf("\n%10s","    Y   ");
sleep(1);
clrscr();
sleep(3);
clrscr();
printf("\n\n\n\n\n\n\n");
printf("\n%20s HAPPY BIRTHDAY %s", "", you);
printf("\n\n\n\n\n\n\n\n");
printf("%30s","My Hearty wishes to you Friend...  ");
sleep(4);
clrscr();
return 0;
}
show3()
{
for(i=5;i>0;i--)
{
clrscr();
printf("\n\n\n\n\t\t\tJourney Begins in %ds",i);
sleep(1);
}
clrscr();
printf("\n\t\t\t\tJourney to Wish a FRIEND");
printf("\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tTenkasi");
printf("                                                                          %c",25);
sleep(1);
printf("\t                                                                          %c",25);
sleep(1);
printf("\t                                                                    %s","ALANGULAM");
sleep(2);
printf("\t                                                                          %c",25);
sleep(1);
printf("\t                                                                          %c",186);
sleep(1);
printf("\t                                                                          %c",186);
sleep(1);
printf("\t                                                                          %c",186);
sleep(1);
printf("\t                                                                    %cR %c Y %c G",178,177,176);
sleep(3);
printf("\t                                                                        %c ",188);
sleep(1);
printf("\t                                                  TIRUNELVELI WELCOMES YOU");
sleep(2);
printf("\t                                                                       %c",25);
sleep(1);
printf("\t                                                                       %c",186);
sleep(1);
printf("\t                                                                       %c",186);
sleep(1);
printf("\t                                                                       %c",186);
sleep(1);
printf("\t                                                            %c%c%c%c%c%c%c%c%c%c%c",205,205,205,205,205,205,205,205,205,205,205,205,185);
sleep(2);
printf("\t                                                             PALYAMKOTTAI");
sleep(2);
printf("\t                                                          %c%c%c%c%c%c%c%c%c",201,205,205,205,205,205,205,205,205);
printf("\t                %c%c%cDR.SACOE%c%c%c%c%c%c%c%c%cKURUMBUR%c%c%c%c%c%c%c%cALWAR%c%c%c%c%c%cSeidunganallur",206,205,205,254,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205);
sleep(2);
clrscr();
printf("\t\t\t\tEEE DEPARTMENT");
sleep(1);
printf("\n\t\t\t%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c",196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196);
sleep(1);
printf("\n\t\t\t%c               %c\n\t\t\t%c               %c\n\t\t\t%c               %c\n\t\t\t%c               %c\n\t\t\t%cHAPPY BIRTHDAY %c\n\t\t\t%c     %s   %c\n\t\t\t%c               %c\n\t\t\t%c               %c",179,179,179,179,179,179,179,179,179,179,179,you,179,179,179,179,179);
sleep(1);
printf("\n\t\t\t%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c",196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,47);
sleep(4);
clrscr();
return 0;
}
show4()
{
clrscr();
for(i=5;i>0;i--)
{
clrscr();
printf("\n\n\n\n\t\t\tSmileys Appears in %ds",i);
sleep(1);
}
clrscr();
for(i=0;i<=381;i++)
printf(" %c%c",1,2);
k=0;

for(i=0;i<15;i++)
{
printf(" %c",ha[k][i]);
sleep(1);
}sleep(1);printf("%s",you);sleep(1);
printf(" \n\t\tEVERY MOMENT IN YOUR LIFE WOULD BE FILLED WITH HAPPINESS ");
for(i=0;i<=319;i++)
printf("%c %c",1,2);
sleep(2);
clrscr();
return 0;
}
show5()
{
clrscr();
for(i=0;i<5;i++)
printf("\n");
printf("\n%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c",196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196);
printf("\n%c               %c       May Everyday Bring Something New and Exciting For You.  %c               %c  May This Birthday Turn Out To Be As Amazing As You.  \n%c               %c    \n%c      PHOTO    %c    .\"\n%c  LOADING...   %c\n%c               %c\n%c               %c",179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179);
printf("\n%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c",196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196);
for(i=0;i<6;i++)
printf("\n");
for(i=0;i<78;i++)
printf("%c",196);
for(i=0;i<4;i++)
{
if(i==0)
{
printf("\t\t\t\t");
call();
for(j=0;j<4;j++)
{
for(k=0;k<11;k++)
{
printf("\b");
}
sleep(1);
call(j);
}
}
for(k=0;k<11;k++)
printf("\b");
if(i==1)
 printf("\t\t\tHAPPY BIRTHDAY %s",you);
sleep(1);
sleep(1);
if(i==2)
printf("\n\t\t\t         by");
sleep(1);
if(i==3)
printf("\n\t\t       Best Friend");
}
sleep(6);
clrscr();

return 0;
}
call(int j)
{
 if(j==0)
printf("     FLASH  NEWS");
 if(j==1)
 printf("     FRESH  NEWS");
 if(j==2)
 printf("     NEWS UPDATE");
return 0;
}
#include<stdio.h>
#include<conio.h>
#include<string.h>
#include<process.h>
#include<dos.h>
int i,j,k,l;
char ha[20][20] = {'H','A','P','P','Y',' ','B','I','R','T','H','D','A','Y'}, you[100];
void main()
{
int coun = 1n;
char r[200], r1[200];

printf("Enter your friend's name to wish ");
gets(you);

do
{
printf("  \n\n\t\t\tBirthday Wishes Platform");
printf("\n\n\t\t\t 1.Box Wishes");
printf("\n\t\t\t 2.Hide and Seek Wishes");
printf("\n\t\t\t 3.Journey to Wish");
printf("\n\t\t\t 4.Smiley Wishes");
printf("\n\t\t\t 5.FLASH NEWS");
printf("\n\t\t\t Press any key other than 1-5 to exit");
printf("\nToday is Your Birthday so Choose what you like to choose %s:",coun==1?"First":coun==2?"Second":coun==3?"Third":coun==4?"Fourth":coun==5?"Fifth":coun==6?"Sixth":"");
scanf("%d",&n);
coun++;
if(n>7||n<=0)
exit(0);
switch(n)
{
case 1:
show1();
break;
case 2:
show2();
break;
case 3:
show3();
break;
case 4:
show4();
break;
case 5:
show5();
break;
default:
exit(0);
}
}while(n>0||n<=7);
getche();
}
show1()
{
for(i=5;i>0;i--)
{

printf("\n\n\n\n\t\t\tBox will Appears within %ds",i);
sleep(1);
}
clrscr();
printf("\t");
for(i=0;i<1;i++)
{
for(j=0;j<14;j++)
{
printf("%4c",ha[i][j]);
}
}
printf("\n\t\t\t");
for(i=0;i<1;i++)
{
for(j=0;j<14;j++)
{
sleep(1);
if(j==5)
{
sleep(2);
printf("\n\t\t\t  HAPPY BIRTHDAY FRIEND\n\t\t\t\t %s"you);
continue;
}
printf("\n%10c\t\t\t\t\t\t\t%c",ha[i][j],ha[i][j]);
}
}
printf("\n\t\tGOD BLESS YOU & ALL YOUR DESIRES COMES TRUE");
sleep(4);
clrscr();
return 0;
}
show2()
{
clrscr();
for(i=5;i>0;i--)
{
clrscr();
printf("\n\n\n\n\t\t\tHide & Seek Starts in %ds",i);
sleep(1);
}
clrscr();
sleep(1);
printf("\n HH   HH");
printf("\n HHHHHHH");
printf("\n HH   HH");
sleep(1);
clrscr();
printf("\n%20s","AAAAAAA");
printf("\n%20s","AA   AA");
printf("\n%20s","AAAAAAA");
printf("\n%20s","AA   AA");
sleep(1);
clrscr();
printf("\n");
printf("\n%50s","PPPPPPP");
printf("\n%50s","PP     PP");
printf("\n%50s","PP     PP");
printf("\n%50s","PPPPPPPPP");
printf("\n%50s","PP       ");
printf("\n%50s","PP       ");
sleep(1);
clrscr();
printf("\n\n");
printf("\n%30s","PPPPPPP");
printf("\n%30s","PP     PP");
printf("\n%30s","PP     PP");
printf("\n%30s","PPPPPPPPP");
printf("\n%30s","PP       ");
printf("\n%30s","PP       ");
sleep(1);
clrscr();
printf("\n\n\n\n\n\n\n");
printf("\n\t\tYY     YY");
printf("\n\t\t YY   YY");
printf("\n\t\t  YY YY ");
printf("\n\t\t    Y   ");
printf("\n\t\t    Y   ");
sleep(1);
clrscr();
printf("\n\n\n");
printf("\n%60s","BBBBBBBBBB");
printf("\n%60s","BB      BB");
printf("\n%60s","BB      BB");
printf("\n%60s","BBBBBBBBBB");
printf("\n%60s","BB      BB");
printf("\n%60s","BB      BB");
printf("\n%60s","BBBBBBBBBB");
sleep(1);
clrscr();
printf("\n\n\n\n\n\n\n\n");
printf("\n%30s","   IIIIII");
printf("\n%30s","     II  ");
printf("\n%30s","     II  ");
printf("\n%30s","     II  ");
printf("\n%30s","   IIIIII");
sleep(1);
clrscr();
printf("\n\n");
printf("\n%20s","  RRRRRRR");
printf("\n%20s","  RR     RR");
printf("\n%20s","  RR     RR");
printf("\n%20s","  RRRRRRRRR");
printf("\n%20s","  RR RR    ");
printf("\n%20s","  RR   RR  ");
printf("\n%20s","  RR     RR");
sleep(1);
clrscr();
printf("\nTTTTTTTT");
printf("\n   TT   ");
printf("\n   TT   ");
printf("\n   TT   ");
sleep(1);
clrscr();
printf("\n");
printf("\n%10s"," HH   HH");
printf("\n%10s"," HHHHHHH");
printf("\n%10s"," HH   HH");
sleep(1);
clrscr();
printf("\n\n\n\n\n\n\n\n\n\n\n");
printf("\n%35s"," DDDDDDD");
printf("\n%35s","   DD    DD");
printf("\n%35s","   DD    DD");
printf("\n%35s","   DD    DD");
printf("\n%35s"," DDDDDDD");
sleep(1);
clrscr();
printf("\n");
printf("\n%80s","AAAAAAA");
printf("\n%80s","AA   AA");
printf("\n%80s","AAAAAAA");
printf("\n%80s","AA   AA");
sleep(1);
clrscr();
printf("\n\n\n\n\n\n\n");
printf("\n%10s","YY     YY");
printf("\n%10s"," YY   YY");
printf("\n%10s","  YY YY ");
printf("\n%10s","    Y   ");
printf("\n%10s","    Y   ");
sleep(1);
clrscr();
sleep(3);
clrscr();
printf("\n\n\n\n\n\n\n");
printf("\n%20s HAPPY BIRTHDAY %s"""you);
printf("\n\n\n\n\n\n\n\n");
printf("%30s","My Hearty wishes to you Friend...  ");
sleep(4);
clrscr();
return 0;
}
show3()
{
for(i=5;i>0;i--)
{
clrscr();
printf("\n\n\n\n\t\t\tJourney Begins in %ds",i);
sleep(1);
}
clrscr();
printf("\n\t\t\t\tJourney to Wish a FRIEND");
printf("\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tTenkasi");
printf("                                                                          %c",25);
sleep(1);
printf("\t                                                                          %c",25);
sleep(1);
printf("\t                                                                    %s","ALANGULAM");
sleep(2);
printf("\t                                                                          %c",25);
sleep(1);
printf("\t                                                                          %c",186);
sleep(1);
printf("\t                                                                          %c",186);
sleep(1);
printf("\t                                                                          %c",186);
sleep(1);
printf("\t                                                                    %cR %c Y %c G",178,177,176);
sleep(3);
printf("\t                                                                        %c ",188);
sleep(1);
printf("\t                                                  TIRUNELVELI WELCOMES YOU");
sleep(2);
printf("\t                                                                       %c",25);
sleep(1);
printf("\t                                                                       %c",186);
sleep(1);
printf("\t                                                                       %c",186);
sleep(1);
printf("\t                                                                       %c",186);
sleep(1);
printf("\t                                                            %c%c%c%c%c%c%c%c%c%c%c",205,205,205,205,205,205,205,205,205,205,205,205,185);
sleep(2);
printf("\t                                                             PALYAMKOTTAI");
sleep(2);
printf("\t                                                          %c%c%c%c%c%c%c%c%c",201,205,205,205,205,205,205,205,205);
printf("\t                %c%c%cDR.SACOE%c%c%c%c%c%c%c%c%cKURUMBUR%c%c%c%c%c%c%c%cALWAR%c%c%c%c%c%cSeidunganallur",206,205,205,254,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205);
sleep(2);
clrscr();
printf("\t\t\t\tEEE DEPARTMENT");
sleep(1);
printf("\n\t\t\t%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c",196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196);
sleep(1);
printf("\n\t\t\t%c               %c\n\t\t\t%c               %c\n\t\t\t%c               %c\n\t\t\t%c               %c\n\t\t\t%cHAPPY BIRTHDAY %c\n\t\t\t%c     %s   %c\n\t\t\t%c               %c\n\t\t\t%c               %c",179,179,179,179,179,179,179,179,179,179,179,you,179,179,179,179,179);
sleep(1);
printf("\n\t\t\t%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c",196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,47);
sleep(4);
clrscr();
return 0;
}
show4()
{
clrscr();
for(i=5;i>0;i--)
{
clrscr();
printf("\n\n\n\n\t\t\tSmileys Appears in %ds",i);
sleep(1);
}
clrscr();
for(i=0;i<=381;i++)
printf(" %c%c",1,2);
k=0;

for(i=0;i<15;i++)
{
printf(" %c",ha[k][i]);
sleep(1);
}sleep(1);printf("%s",you);sleep(1);
printf(\n\t\tEVERY MOMENT IN YOUR LIFE WOULD BE FILLED WITH HAPPINESS ");
for(i=0;i<=319;i++)
printf("%c %c",1,2);
sleep(2);
clrscr();
return 0;
}
show5()
{
clrscr();
for(i=0;i<5;i++)
printf("\n");
printf("\n%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c",196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196);
printf("\n%c               %c       May Everyday Bring Something New and Exciting For You.  %c               %c  May This Birthday Turn Out To Be As Amazing As You.  \n%c               %c    \n%c      PHOTO    %c    .\"\n%c  LOADING...   %c\n%c               %c\n%c               %c",179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179);
printf("\n%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c",196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196);
for(i=0;i<6;i++)
printf("\n");
for(i=0;i<78;i++)
printf("%c",196);
for(i=0;i<4;i++)
{
if(i==0)
{
printf("\t\t\t\t");
call();
for(j=0;j<4;j++)
{
for(k=0;k<11;k++)
{
printf("\b");
}
sleep(1);
call(j);
}
}
for(k=0;k<11;k++)
printf("\b");
if(i==1)
 printf("\t\t\tHAPPY BIRTHDAY %s",you);
sleep(1);
sleep(1);
if(i==2)
printf("\n\t\t\t         by");
sleep(1);
if(i==3)
printf("\n\t\t       Best Friend");
}
sleep(6);
clrscr();

return 0;
}
call(int j)
{
 if(j==0)
printf("     FLASH  NEWS");
 if(j==1)
 printf("     FRESH  NEWS");
 if(j==2)
 printf("     NEWS UPDATE");
return 0;
}


C Problems

 

//write a program to arithemetic operation in c
#include<stdio.h>
void main()
{
int x,y,ans,choice,a;
char yes='Y';
do
{
printf("!!!!!!!!!!!!!!!!!!!!!!!!!\n");
printf("arithemetic calculator\n");
printf("1.Add\n");
printf("2.sub\n");
printf("3.multi\n");
printf("4.divi\n");
printf("!!!!!!!!!!!!!!!!!!!!!!!!!!\n");
printf("Please enter the choice\n");
scanf("%d",&choice);

switch(choice)
{
    case 1printf("Enter the two number to add:\n");
            scanf("%d%d",&x,&y);
             ans=x+y;
            printf("Ans is %d\n",ans);
            break;
    defaultprintf("enter choice is invalid\n");
            break;
}

printf("\n\n\nDo You Want To Use Again(Y or N)??????\n");
fflush(stdin);
scanf("%c",&yes);

a=1;


}

while(a>6);
printf("Thanking for using it");


}

2.)
#include<stdio.h>
void main()
{
int x,y,ans;
printf("Enter the two number:\n");
scanf("%d%d",&x,&y);
if(ans=x+y)
printf("Ans is %d",ans);
else
{
if(ans=x-y)
printf("Ans is %d",ans);
else
{
if(ans=x*y)
printf("Ans is %d",ans);
else
{
if(ans=x/y)
printf("Ans is %d ",ans);
else
{
printf("Ans is Invalid ");


}

}
}


}






}

3.)
// C program to draw a moving car. This
// program run in gcc compiler having
// graphics.h library installed

#include <stdio.h>

// Function to draw moving car
void draw_moving_car(void) {

    int i, j = 0;

    // Passed three arguments to initgraph
    // function to initialize graphics mode


    for (i = 0; i <= 420; i = i + 10) {

        // Set color of car as red


        // Thease lines for bonnet and
        // body of car
        line(0 + i, 300210 + i, 300);
        line(50 + i, 30075 + i, 270);
        line(75 + i, 270150 + i, 270);
        line(150 + i, 270165 + i, 300);
        line(0 + i, 3000 + i, 330);
        line(210 + i, 300210 + i, 330);

        // For left wheel of car
        circle(65 + i, 33015);
        circle(65 + i, 3302);

        // For right wheel of car
        circle(145 + i, 33015);
        circle(145 + i, 3302);

        // Line left of left wheel
        line(0 + i, 33050 + i, 330);

        // Line middle of both wheel
        line(80 + i, 330, 130 + i, 330);

        // Line right of right wheel
        line(210 + i, 330, 160 + i, 330);

        delay(100);

        // To erase previous drawn car, draw
        // the whole car at same possition
        // but color using black


        // Lines for bonnet and body of car
        line(0 + i, 300, 210 + i, 300);
        line(50 + i, 300, 75 + i, 270);
        line(75 + i, 270, 150 + i, 270);
        line(150 + i, 270, 165 + i, 300);
        line(0 + i, 300, 0 + i, 330);
        line(210 + i, 300, 210 + i, 330);

        // For left wheel of car
        circle(65 + i, 330, 15);
        circle(65 + i, 330, 2);

        // For right wheel of car
        circle(145 + i, 330, 15);
        circle(145 + i, 330, 2);

        // Line left of left wheel
        line(0 + i, 330, 50 + i, 330);

        // Line middle of both wheel
        line(80 + i, 330, 130 + i, 330);

        // Line right of right wheel
        line(210 + i, 330, 160 + i, 330);
    }

    getch();

    closegraph();
}

// Driver code
int main()
{
    draw_moving_car();

    return 0;
}

4.)
//write a program to find round off the numbers
//author:upendra
#include<stdio.h>
#include<math.h>
void main()
{
int cel,flr;
float a;
printf("enter the number to round off in ceiling and floor:\n");
scanf("%f",&a);
cel=ceil(a);
flr=floor(a);
printf("Round off value to ceiling is %d\n\n\n",cel);
printf("Round off value to floor is %d",flr);


}

5.)
/* write a program to print
a to z using while loop*/
#include<stdio.h>
void main()
{
char ch='a';
while(ch<='z')
{
printf("%c",ch);
ch++;
}
}

6.)
// write a program to get character ASCII value
// author: upendra date:10/27/2020
#include<stdio.h>
void main()
{
char a,b,c; // a,b,c are character variables
a='70';
b='71';
printf("Character is %c",a,b);









}

7.)
/* write a program to identify whether it is
character or not*/

#include<stdio.h>
void main()
{
char ch; //ch is a character variable
printf("Enter any character :");
scanf("%c",&ch);
if(ch>='a'&&ch<='z')
{printf("it is a alphabet");}
else{
if(ch>='A'&&ch<='Z')
{printf("it is a alphabet");}
else
{printf("it is not a alphabet");}
}
}

8.)
/*switch can also written for char
expression*/
#include<stdio.h>
void main()
{
char ch='z';
switch(ch)
{
case 'a':
printf("this is 'a'");
break;
case 'z':
printf("this is 'z'");
break;
default:
printf("User input is invalid");




}


}

9.)
//write a basic problem on relational operator
//author:upendra
#include<stdio.h>
void main()
{
int a,b,result;
printf("Note: 1=true and 0=false:\n");
printf("Enter the two numbers:\n");
scanf("%d%d",&a,&b);
result=a!=b;
printf("Result is %d",result);



}

10.)
#include<stdio.h>
void main()
{
char yes='Y';
int x,y;

{while(yes=='Y')
printf("Enter two numbers x and y\n");
scanf("%d%d",&x,&y);
printf("%d\n",x+y);
printf("Do you want to continue? press Y- Yes or N- No");
scanf("%c",&yes);

}
}

11.)


#include<stdio.h>
void main()
{
    float ar,b,h; // ar is area of a triangle , b is breath of triangle ,h is height
    printf("Enter the two values b,h");
    scanf("%f%f",b,h);
    ar= 1/2(b*h);
    printf("Area is %f",ar);




}


#include<stdio.h>
void main()
{
    float ar,b,h; // ar is area of a triangle , b is breath of triangle ,h is height
    printf("Enter the two values b,h");
    scanf("%f%f",b,h);
    ar= 1/2(b*h);
    printf("Area is %f",ar);




}
12.)
// write a program to convert distance b|w the two cities in meter
//inch,centimeter
//author:upendra yadav date:10/27/2020
#include<stdio.h>
void main()
{
int m,cm,km;
float ft,inch;
printf("Enter the distance b|w two cities in Km:\n");
scanf("%d",&km);
m=1000*km;
cm=m*100;
ft=cm/30.48;
inch=cm/2.54;
/* converts following answer is */
printf("the distance b|w two cities in meter is %d\n\n",m);
printf("the distance b|w two cities in Centimeter is %d\n\n",cm);
printf("the distance b|w two cities in Foot is %f\n\n",ft);
printf("the distance b|w two cities in inchs is %f\n\n",inch);










}

13.)
/*write a program to find the no. of a note in amount
*/
#include<stdio.h>
void main()
{
int amount;
printf("Enter the total amount:\n");
scanf("%d",&amount);
if(amount==500)
printf("500:");
else{
if(amount==100)
printf("100:");
else
{
if(amount==50)
printf("50:");}}}

14.)
#include<stdio.h>
 squa(float);
void main()
{
float x,y;
printf("Enter the one value to square:\n");
scanf("%f",&x);
y=squa(x);
printf("answer is %f",y);


}
squa(float a)
{
float ans;
ans=a*a;
return ans;




}

15.)
/* write a program where number is divisible
3 or 4 or not */

#include<stdio.h>
void main()
{int year;
printf("enter a year:");
scanf("%d",&year);
if(year%4==0)
{
    printf("year is a leap year");

}
else
{
    printf("year is not leap year");
}

}

16.)
#include<stdio.h>
void main()
{
int a=0;
do
{
printf("system is hacked m'aam");
}
while(a>-1);
}

17.)
//write a program to calculate electricity bill

#include<stdio.h>
void main
{
int units;//units-electricity,surcharge-20%
float Rupees; //rupees in rupees
printf("Enter the Electricity Units:\n");
scanf("%d",units);
if(units<=50)

Rupees=0.50*units;
printf("Electricity amount is %f",Rupees);
else
{
if(units<=150)

Rupees=0.75*units;
printf("Electricity amount is %f",Rupees);

else
if(units<=250)

Rupees=1.20*units;
printf("Electricity amount is %f",Rupees);


else
if(units>=250)

Rupees=1.50*units;
printf("Electricity amount is %f",Rupees);






}











}

18.)
//write a program for elctricity bill calculation
//if sur_charge if 20%
#include<stdio.h>
void main()
{
int units;
float amt,sur_charge,total_amt;
printf("Enter the units consumed:\n");
scanf("%d",&units);
if(units<=50)
{
amt=0.50*units;

}
else if(units<=150)
{
amt=25+((units-50)*0.75);


}
else if(units<=250)
{
amt=100+((units-150)*1.20);

}
else if(units>=250)
{
amt=220+((units-250)*1.50);
}

sur_charge=amt*0.20;
total_amt=sur_charge+amt;

printf("Your this months Electricity Bill is %2f",total_amt);

}

C problems

 

//write a program to find largest number btw thw num
//author:upendra yadav date:10/29/2020
#include<stdio.h>
void main()
{
int num1,num2;
printf("Enter the two numbers to compare :\n");
scanf("%d%d",&num1,&num2);
if(num1>num2?num1:num2)
printf("greater number is %d",num2);
else
{

printf("greater number is %d",num1);


}



}

2.)

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

int main()
{
    /*
      Declaration of variables used
    */

    showframe(12,25);
    printf("\nPlayer 1, enter your name:");
     fgets(name[0], 30, stdin);
    printf("\nPlayer 2, enter your name:");
     fgets(name[1], 30, stdin);

    printf("\n%s, you take 0",name[0]);
    printf("\n%s, you take X",name[1]); getch();

    clrscr();

    do
    {
       while(!enter)
       {
         if(khbit())
          ch = getch();

           switch(ch)
           {
             case UPARROW : box = navigate(a[3][3], box, player, UPARROW);
             .
             .
             .
           }
       }
       if(quit) break;
       //check if the player wins
       win = checkforwin(a);

     }while(!win)

    if(win)
    { .
      .
    }

    else if(quit)
    {    .
         .
    }

 return 0;
}
}

3.)
  #include<stdio.h>
  void main()
  {
  float m;
  printf("Enter the value of m:\n");
  scanf("%f",&m);
  m/=10;
  printf("Answer is %f",m);
  }

4.)
#include<stdio.h>
void main()
{
int pin;
while(pin!=5135)
{
printf("Enter the Secret pin:");
scanf("%d",&pin);
if(pin!=5135)
printf("Enter Pin is Invalid\n");
else
{
printf("Enter Pin is correct");

}
}

}

5.)
/* write a program to withdrawal a amount
from the bank*/
#include<stdio.h>
void main()
{
char E,H,M;
printf("Press 'E' for English\n'H' for Hindi\n'M' for marathi\n");
scanf("%c%c%c",&E,&H,&M);



}

6.)
/*
 * C Program to Display the ATM Transaction
 */
#include <stdio.h>

unsigned long amount=1000, deposit, withdraw;
int choice, pin, k;
char transaction ='y';

void main()
{
    while (pin != 1520)
    {

        printf("ENTER YOUR SECRET PIN NUMBER:");
        scanf("%d", &pin);
        if (pin != 1520)
        printf("PLEASE ENTER VALID PASSWORD\n");


    }

    do
    {
        printf("********Welcome to ATM Service**************\n");
        printf("1. Check Balance\n");
        printf("2. Withdraw Cash\n");
        printf("3. Deposit Cash\n");
        printf("4. Quit\n");
        printf("******************?**************************?*\n\n");
        printf("Enter your choice: ");
        scanf("%d", &choice);
        switch (choice)
        {
        case 1:
            printf("\n YOUR BALANCE IN Rs : %lu ", amount);
            break;
        case 2:
            printf("\n ENTER THE AMOUNT TO WITHDRAW: ");
            scanf("%lu", &withdraw);
            if (withdraw % 100 != 0)
            {
                printf("\n PLEASE ENTER THE AMOUNT IN MULTIPLES OF 100");
            }
            else if (withdraw >(amount - 500))
            {
                printf("\n INSUFFICENT BALANCE");
            }
            else
            {
                amount = amount - withdraw;
                printf("\n\n PLEASE COLLECT CASH");
                printf("\n YOUR CURRENT BALANCE IS%lu", amount);
            }
            break;
        case 3:
            printf("\n ENTER THE AMOUNT TO DEPOSIT");
            scanf("%lu", &deposit);
                        amount = amount + deposit;
            printf("YOUR BALANCE IS %lu", amount);
            break;
        case 4:
            printf("\n THANK U USING ATM");
            break;
        default:
            printf("\n INVALID CHOICE");
        }
        printf("\n\n\n DO U WISH TO HAVE ANOTHER TRANSCATION?(y/n): \n");
        fflush(stdin);
        scanf("%c", &transaction);
        if (transaction == 'n'|| transaction == 'N')
                    k = 1;
    } while (!k);
    printf("\n\n THANKS FOR USING OUT ATM SERVICE");
}

7.)
#include<stdio.h>
void main()
{unsigned long amount=50000,deposit,withdraw;
 int choice,pin,k;
 char transaction='y';
 while(pin!=2408)
 {
     printf("Enter secret pin:");
     scanf("%d",&pin);
     if(pin!=2408)
        printf("Enter The Valid Pin");

 }
do
{
    printf("**************Welcome To HDFC Bank**************\n");
    printf("1.check Balance\t");
    printf("        2.withdrawal amount\n");
    printf("3.Deposit amount\t");
    printf("4.Quit\n");
    printf("************************************************\n");
    printf("Enter the choice\n");
    scanf("%d",&choice);
    switch(choice)
    {
    case 1:
        printf("Your Balance is Rs:%lu",amount);
        break;
    case 2:
        printf("Enter the Amount Withdraw:");
        scanf("%lu",&withdraw);
        if(withdraw%100!=0)
        {
            printf("\n Enter withdraw anount in multiple of 100");

        }
        else if(withdraw>(amount-1000))
               {

               printf("\n insufficient balance");
        }
        else
               {amount=amount-withdraw;

                printf("\n\n Please Collect Your cash");
                printf("\n Your current balance is %lu",amount);
            }
            break;
    case 3:
        printf("\nEnter the amount Deposit:");
        scanf("%lu",&deposit);
        amount=amount+deposit;
        printf("\nYour balance is %lu",amount);
        break;
    case 4:
        printf("\n Thanking Using ATM service");
        break;
    default:
        printf("\nInvalid choice");

    }
        printf("\n\n\nDo You Want Another Transaction('y or n')?\n");
        fflush(stdin);
        scanf("%c",&transaction);
        if(transaction=='n'||transaction=='N')
            k=2;
}
while(k>5);
    printf("\n Thankyou for using out your atm service ");

    }



8.)
//write a program to find big number
//author :upendra
#include<stdio.h>
void main()
{
int a,b,big;
printf("enter the two numbers:\n");
scanf("%d%d",&a,&b);
big=(a>b)?a:b;
printf("Big number is %d",big);









}
9.)
/*write a program to check birthday
boy name by putting input  of birth year*/
#include<stdio.h>
void main()
{
int year;
printf("Enter the year of a birth:\n");
scanf("%d",&year);
if(year==1971)
    printf("Happy Birthday Dad");
else{
    if(year==1975)
        printf("Happy Birthday Mom");
    else{
        if(year==1992)
            printf("Happy Birthday Bhupendra");
            else{
                if(year==1995)
                    printf("happy Birthday maya");
                else{
                    if(year==2000)
                    printf("Happy birthday Upendra");
                    else{
                        if(year==2005)
                            printf("Happy Birthday nitesh");
                        else
                            {
                                if(year==2009)
                                    printf("happy Birthday chhottu");
                                else
                                    printf("User Input is undefined");
                            }

                    }

                }
            }

    }
}
}

10.)
#include<stdio.h>
void main()
{
int n;
while(n<10)
{
printf("%d\n",n);
n++;
continue;
printf("This will not apper");
}

printf("\n this will appear");
}

C Programs Problems

 

#include<stdio.h>
void main()
{
char varchar;
varchar='A';
printf("%c",varchar);



}

2)
#include<stdio.h>
void main()
{
int a;
for(a=2;(a/2)>=0&&(a/2)<=100;a++)
printf("%d\n",a);}

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

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

5)
//write a program to find absoolute value of any functions
//author:upendra
#include<stdio.h>
#include<math.h>
void main()
{
int a,Abs_val;
printf("Enter the number to find its absolute value:\n");
scanf("%d",&a);
Abs_val=fabs(a);
printf("Absolute value of number is %d",Abs_val);
}

6.)
// write a program to add character to get third character
//author: Upendra date:10/27/2020
#include <stdio.h>
void main()
{

    char ab;
    int z;
    printf("Enter the two characters:\n");
    scanf("%c%c", &a, &b);
    z = a + b;
    printf("Third character is %c"z);
}

7.)
/*write a program to take addmission in college
on following condition */
#include <stdio.h>
void main()
{
    int percage;
    char gendergame;
    printf("Press M for male \n Press F for female \n Press Y for played game \n Press N for not played game");
    scanf("%c%d%d", &gender, &perc, &age);
    printf("Did you played any game at national level \n");
    scanf("%c"game);
    if ((perc >= 80 && age >= 18 && gender == 'M') || (perc >= 70 && age >= 17 && gender == 'F'))
        ;
    printf("You can take addmission in college");
    {
        else
        {
            if (game == 'Y')
                printf("you can take addmission in sport kota");
            else
                printf("You can't take addmission in college");
        }
    }
}

8.)
#include<stdio.h>
void main()
{
int perc,age;
char gen,game;
printf("press M for male n F for female n Y for played game n N for not played game n");
scanf("%c%d%d",&gen,&perc,&age);
printf("did you played national game");
scanf("%c",&game);
if(perc>=80&&age>=18&&gen=='M'||perc>=70&&age>=17&&gen=='F')
    printf("You can take addmission in college");
}

9.)
#include<stdio.h>
void main()
{
int a=6;
do
{
printf("***********Welcome to air India***************\n");
printf("1.check your bags\n");
printf("2.check to switch off your device\n");
printf("3.check your ticket kept it safe\n");
printf("4.check your seat belt is tied properly\n");
printf("**********Have a Nice Happy journey************\n");
}
while(a<9);

}

10.)
/* write a program to check whether
 the alphabet is vowel or consonant */

#include<stdio.h>
void main()
{
    char ch;
    int n;
    printf("Enter any character:");
    scanf("%c%d",&ch,&n);
    if()


}


Digibytes - research

 

Diff b\w

Bitcoin and Digibyte

1. block---> 15s --Digi

2. block ---> 10m --Bit

3. transaction per second ---> 560 and BIT---->7 

4.Limited Supply But 21Billion only

last will be mined at 2035 year

5.Limited supply but 21million only lst mined 

at 2140


Python if / else

 Python if / else a1 = int ( input (" Enter the number: \n ")) a2 = int ( input (" Enter the number: \n ")) a3 = int ( i...