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;
}


No comments:

Python if / else

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