Profile cover photo
Profile photo
C LANGUAGE TUTORIAL
159 followers
159 followers
About
C LANGUAGE TUTORIAL's posts

CREATE HANDPUMP IN C LANGUAGE




#include<stdio.h>
#include<conio.h>
#include<dos.h>
void main()
{
int a,b,d=17;
uper:
clrscr();
for(a=0;a<=23;a++)
{
for(b=0;b<=30;b++)
{
if((a==0&&b<=10)||
(a>=0&&b==0)||
(a>=0&&b==10)||
(a==23&&b<=10)||
(a>=9&&a<10&&b>=11&&b<=30)||
(a>=11&&a<12&&b>=11&&b<=26)||
(a>=9&&a<=15&&b==30)||
(a>=11&&a<=15&&b==26)||
(a==15&&b>=27&&b<=30))
{
printf("*");
}
else
{
printf(" ");
}
}
printf("\n");
}
gotoxy(2,3);
printf("HANDPUMP");
gotoxy(3,6);
printf("CREATED");
gotoxy(5,9);
printf("BY");
gotoxy(3,12);
printf("SHABBIR");
gotoxy(3,14);
printf("RATLAM");
up:
textcolor(7);
gotoxy(27,d);
cprintf(", , ,");
delay(500);
d++;
if(d==25)
{
d=17;
goto uper;
}
if(!kbhit())
goto up;

getch();
}

CREATE ATM IN C LANGUAGE



#include<stdio.h>
#include<conio.h>
#include<process.h>
void main()
{
long int a=0,b=0,c=0,d;
char e;
do
{
clrscr();
printf("\n\t\t\tAUTOMATED TELLER MACHINE");
printf("\n\n\n\n\t1. DEPOSIT YOUR AMOUNT");
printf("\n\n\t2. WITHDRAW YOUR AMOUNT");
printf("\n\n\t3. DISPLAY YOUR AMOUNT");
printf("\n\n\t4. EXIT\n\n");
scanf("%ld",&d);
switch(d)
{
case 1:
clrscr();
a=0;
printf("\n\n\t\t\tDEPOSIT YOUR AMOUNT");
printf("\n\n\n\n\tCURRENT BALANCE IS\t%ld",c);
printf("\n\n\tDEPOSIT MONEY\t");
scanf("%ld",&a);
c=c+a;
break;

case 2:
clrscr();
b=0;
printf("\n\n\t\t\tWITHDRAW YOUR AMOUNT");
printf("\n\n\n\n\tCURRENT BALANCE IS\t%ld",c);
printf("\n\n\n\n\tWITHDRAW MONEY\t");
scanf("%ld",&b);
c=c-b;
break;

case 3:
clrscr();
printf("\n\n\t\t\tDISPLAY YOUR AMOUNT");
printf("\n\n\n\n\tCURRENT BALANCE IS\t%ld",c);
getch();
break;

default:
clrscr();
printf("\n\n\n\tTHE ENTERED NUMBER IS NOT VALID");
getch();
break;

case 4:
exit(0);
}
}
while(e!=4);
}

CREATE A NUMBER TABLE IN C LANGUAGE



#include<stdio.h>
#include<conio.h>
void main()
{
long int a,b;
clrscr();
printf("ENTER A NUMBER\t");
scanf("%ld",&a);
clrscr();
for(b=1;b<=10;b++)
{
printf("\n%ld\t*\t%ld\t=\t%ld",a,b,a*b);
}
getch();
}

CREATE LAPTOP IN C LANGUAGE




#include<stdio.h>
#include<conio.h>
void main()
{
int a,b,c,d;
clrscr();
d=2;
for(a=0;a<=22;a++)
{
c=2;
for(b=0;b<=70;b++)
{
if((a==0&&b>=0)||
(a==10&&b>=0)||
(a==22&&b>=0))
{
gotoxy(c,d);
printf("_");
c++;
}
else if((a>=0&&b==0)||
(a>=0&&b==70))
{
gotoxy(c,d);
printf("|");
c++;
}
else
{
gotoxy(c,d);
printf(" ");
c++;
}
}
d++;
}
gotoxy(2,12);
printf("");
gotoxy(72,12);
printf("");
gotoxy(2,3);
printf("");
gotoxy(72,3);
printf("");
gotoxy(2,24);
printf("");
gotoxy(72,24);
printf("");
gotoxy(1,11);
printf("(");
gotoxy(1,13);
printf("(");
gotoxy(73,11);
printf(")");
gotoxy(73,13);
printf(")");
d=13;c=2;
for(a=0;a<=70;a++)
{
gotoxy(c,d);
printf("_");
c++;
}
d=11;c=2;
for(a=0;a<=70;a++)
{
gotoxy(c,d);
printf("_");
c++;
}
d=14;
for(a=0;a<=7;a++)
{
c=3;
for(b=0;b<=68;b++)
{
if((a==1&&b>=0)||
(a==3&&b>=0)||
(a==5&&b>=0)||
(a==7&&b>=0))
{
gotoxy(c,d);
printf("_");
c++;
}
else
{
gotoxy(c,d);
printf(" ");
c++;
}
}
d++;
}
gotoxy(3,14);
printf("Esc");
d=14;c=8;
for(a=1;a<=12;a++)
{
gotoxy(c,d);
printf("F%d",a);
c=c+4;
}
gotoxy(56,14);
printf("Prt");
gotoxy(60,14);
printf("PB");
gotoxy(63,14);
printf("Win");
gotoxy(67,14);
printf("page");
d=16;c=3;
for(a=1;a<=9;a++)
{
gotoxy(c,d);
printf("%d",a);
c=c+4;
}
gotoxy(39,16);
a=0;printf("%d",a);
gotoxy(43,16);
printf("-_");
gotoxy(47,16);
printf("+=");
gotoxy(51,16);
printf("BKSP");
gotoxy(58,16);
printf("HOME");
gotoxy(64,16);
printf("PGUP");
gotoxy(69,16);
printf("END");
gotoxy(3,18);
printf("TAB Q W E R T Y U I O P {[ ]} \\| ENTER RSHIFT PGDN INS");
gotoxy(3,20);
printf("CPL A S D F G H J K L :; '"" DEL ALT RCTRL LA UA RA");
gotoxy(3,22);
printf("Lctrl lSHIFT ~` ALT Z X C V B N M SPACE <, >. ?/ DA");
gotoxy(24,7);
textcolor(10);
cprintf("SHABBIR RATLAM LAPTOP");
getch();
}

CREATE MOBILE IN C LANGUAGE





#include<stdio.h>
#include<conio.h>
void main()
{
int a,b,c=1,f,g;
clrscr();
g=5;
for(a=0;a<=16;a++)
{
f=30;
for(b=0;b<=10;b++)
{
if
((a>=0&&b==0)||
(a>=0&&b==10))
{
gotoxy(f,g);
textcolor(8);
cprintf("|");
f++;
}
else if((a==0&&b>=0)||
(a==2&&b>=0)||
(a==8&&b>=0)||
(a==16&&b>=0))
{
gotoxy(f,g);
textcolor(8);
cprintf("_");
f++;
}
else
{
gotoxy(f,g);
printf(" ");
f++;
}
}
g++;
}
gotoxy(31,6);
printf("C2 NOKIA");
g=17;
for(a=0;a<=2;a++)
{
f=32;
for(b=0;b<=2;b++)
{
gotoxy(f,g);
textcolor(9);
cprintf("%d",c);
f=f+3;
c++;
}
g++;
}
textcolor(9);
gotoxy(32,20);
cprintf("*");
gotoxy(35,20);
cprintf("0");
gotoxy(38,20);
cprintf("#");
gotoxy(32,14);
printf("_");
textcolor(10);
gotoxy(32,15);
cprintf("_");
gotoxy(38,14);
printf("_");
textcolor(4);
gotoxy(38,15);
cprintf("_");
gotoxy(34,15);
printf("|");
gotoxy(35,14);
printf("_");
gotoxy(36,15);
printf("|");
gotoxy(35,15);
printf("_");
gotoxy(32,10);
printf("SHABBIR");
gotoxy(32,11);
printf(" RATLAM");
getch();
}

CREATE DIAMOND IN C





#include<stdio.h>
#include<conio.h>
void main()
{
int a,b,c,d,e;
clrscr();
e=3;
for(a=0;a<=9;a++)
{
d=25;
for(b=9;b>=a;b--)
{
gotoxy(d,e);
printf(" ");
d++;
}
for(c=0;c<=a;c++)
{
gotoxy(d,e);
printf(" *");
d=d+2;
}
e++;
}
e=13;
for(a=8;a>=0;a--)
{
d=25;
for(b=9;b>=a;b--)
{
gotoxy(d,e);
printf(" ");
d++;
}
for(c=0;c<=a;c++)
{
gotoxy(d,e);
printf(" *");
d=d+2;
}
e++;
}
getch();
}

CREATE STARTING OF WINDOWS IN C

#include<stdio.h>
#include<conio.h>
#include<dos.h>
#include<string.h>
void main()
{
int a,b,c,d,e=254,h,i;
char f[10]={"SHABBIR"},g[10];
clrscr();
d=5;
for(a=0;a<=10;a++)
{
c=8;
for(b=0;b<=60;b++)
{
if((a==0&&b<=6)||
(a>=0&&b==3)||
(a>=0&&b==9)||
(a==0&&b>=9&&b<=15)||
(a==10&&b>=9&&b<=15)||
(a>=0&&b==15)||
(a==0&&b>=18&&b<=24)||
(a>=0&&a<=5&&b==18)||
(a==5&&b>=18&&b<=24)||
(a>=5&&b==24)||
(a==10&&b>=18&&b<=24)||
(a>=0&&b==27)||
(a==5&&b>=27&&b<=32)||
(a>=0&&b==33)||
(a==0&&b>=36&&b<=42)||
(a>=0&&b==39)||
(a==10&&b>=36&&b<=42)||
(a>=0&&b==45)||
(a>=0&&b==51)||
(a==0&&b>=45&&b<=51)||
(a==5&&b>=47&&b<=51)||
(a==10&&b>=45&&b<=51)||
(a>=0&&b==54)||
(a>=0&&b==60)||
(a==5&&b>=54)||
(a==0&&b>=54))
{
textcolor(4);
gotoxy(c,d);
cprintf("*");
c++;
}
else
{
gotoxy(c,d);
printf(" ");
c++;
}
}
d++;
}
textcolor(13);
gotoxy(12,18);
cprintf("IN TOUCH WITH TOMMOROW");
delay(3000);
clrscr();
delay(2000);
textcolor(4);
gotoxy(36,13);
cprintf("%c",e);
delay(2000);
textcolor(10);
gotoxy(38,13);
cprintf("%c",e);
delay(2000);
textcolor(14);
gotoxy(36,14);
cprintf("%c",e);
delay(2000);
textcolor(9);
gotoxy(38,14);
cprintf("%c",e);
delay(1000);
textcolor(7);
gotoxy(30,16);
cprintf("STARTING WINDOWS");
delay(5000);
a:
clrscr();
gotoxy(35,8);
printf("SHABBIR");
d=10;
for(a=0;a<=2;a++)
{
c=32;
for(b=0;b<=15;b++)
{
if(a==1&&b>=1&&b<=14)
{
gotoxy(c,d);
printf(" ");
c++;
}
else
{
gotoxy(c,d);
printf(".");
c++;
}
}
d++;
}
textcolor(7);
gotoxy(22,11);
cprintf("PASSWORD");
gotoxy(35,11);
for(i=0;i<=6;i++)
{
g[i]=getch();
textcolor(9);
cprintf("");
}
getch();
h=strcmp(f,g);
if(h==0)
{
gotoxy(30,20);
printf("login");
delay(3000);
}
else
{
gotoxy(30,20);
printf("not login");
delay(1000);
goto a;
}
clrscr();
d=5;
for(a=0;a<=10;a++)
{
c=10;
for(b=0;b<=63;b++)
{
if((a>=0&&b==0)||
(a==10&&b>=0&&b<=3)||
(a>=0&&b==4)||
(a==10&&b>=4&&b<=7)||
(a>=0&&b==8)||
(a>=0&&b==11)||
(a==0&&b>=11&&b<=16)||
(a==5&&b>=11&&b<=16)||
(a==10&&b>=11&&b<=16)||
(a>=0&&b==19)||
(a==10&&b>=19&&b<=25)||
(a>=0&&b==28)||
(a==0&&b>=28&&b<=34)||
(a==10&&b>=28&&b<=34)||
(a>=0&&b==37)||
(a>=0&&b==43)||
(a==0&&b>=37&&b<=43)||
(a==10&&b>=37&&b<=43)||
(a>=0&&b==46)||
(a>=0&&b==50)||
(a>=0&&b==54)||
(a==0&&b>=46&&b<=54)||
(a>=0&&b==57)||
(a==0&&b>=57)||
(a==5&&b>=57)||
(a==10&&b>=57))
{
textcolor(9);
gotoxy(c,d);
cprintf("*");
c++;
}
else
{
gotoxy(c,d);
cprintf(" ");
c++;
}
}
d++;
}
getch();
}

THE PASSWORD IS "SHABBIR".

REVERSE THE ENTERED NUMBER

#include<stdio.h>
#include<conio.h>
void main()
{
long int a,b,c,d=0;
clrscr();
printf("ENTER A NUMBER\t");
scanf("%ld",&a);
for(b=0;b<=a;b++)
{
if(a>9)
{
c=a%10;
d=(d*10)+(c*10);
a=a/10;
}
}
d=d+a;
printf("\n\nTHE REVERSE NUMBER IS\t%ld",d);
getch();
}

CREATE A MARKSHEET IN C LANGUAGE

#include<stdio.h>
#include<conio.h>
#include<dos.h>
void main()
{
long int a,b,c,total,d;
float per;
char ch;
up:
p:
clrscr();
gotoxy(1,2);
printf("THE MARKS OBTAINED OUT OF 100");
printf("\n\n\nENTER YOUR ROLL NO\t");
scanf("%ld",&d);
clrscr();
m:
printf("\nENTER THE MARKS OF MATHS =\t");
scanf("%ld",&a);

if(a>100)
{
printf("\nnumber is invalid ");
delay(1000);
clrscr();
goto m;
}
clrscr();
n:
printf("\nENTER THE MARKS OF ENGLISH =\t");
scanf("%ld",&b);

if(b>100)
{
printf("\nnumber is invalid ");
delay(1000);
clrscr();
goto n;
}
clrscr();
o:
printf("\nENTER THE MARKS OF HINDI =\t");
scanf("%ld",&c);

if(c>100)
{
printf("\nnumber is invalid ");
delay(1000);
clrscr();
goto o;
}

clrscr();
gotoxy(10,10);
printf("WAIT FOR 5 SECOND............");
delay(1000);
gotoxy(10,20);
printf("your page is loading................");
delay(5000);
clrscr();
if(d>=0)
{
gotoxy(30,4);
printf("MARKSHEET");
printf("\n\nROLL NO\t\t%ld",d);
printf("\n\n\t\tMATHS \t%ld",a);
printf("\n\t\tENGLISH \t%ld",b);
printf("\n\t\tHINDI \t%ld",c);
total=a+b+c;
printf("\n\n\t\tTOTAL\t\t%ld",total);
per=total/3;
printf("\n\n\t\tPERCENTAGE\t%.2f",per);
}
else
{
clrscr();
gotoxy(10,10);
printf("roll no is invalid");
gotoxy(10,12);
printf("wait for second");
delay(5000);
goto p;
}
if(per>=90)
{
printf("\nGRADE A+");
if(a>=75)
{
printf("\nDISTINCTION IN MATHS");
}
if(a<=39)
{
printf("\nCOMPARTMENT IN MATHS");
}
if(b>=75)
{
printf("\nDISTINCTION IN ENGLISH");
}
if(b<=39)
{
printf("\nCOMPARTMENT IN ENGLISH");
}
if(c>=75)
{
printf("\nDISTINCTION IN HINDI");
}
if(c<=39)
{
printf("\nCOMPARTMENT IN HINDI");
}
/////////////////////////////////////////////////////
}
else if(per>=80)
{
printf("\nGRADE A");
if(a>=75)
{
printf("\nDISTINCTION IN MATHS");
}
if(a<=39)
{
printf("\nCOMPARTMENT IN MATHS");
}
if(b>=75)
{
printf("\nDISTINCTION IN ENGLISH");
}
if(b<=39)
{
printf("\nCOMPARTMENT IN ENGLISH");
}
if(c>=75)
{
printf("\nDISTINCTION IN HINDI");
}
if(c<=39)
{
printf("\nCOMPARTMENT IN HINDI");
}
//////////////////////////////////////////////////////////////////
}
else if(per>=70)
{
printf("\nGRADE B");
if(a>=75)
{
printf("\nDISTINCTION IN MATHS");
}
if(a<=39)
{
printf("\nCOMPARTMENT IN MATHS");
}
if(b>=75)
{
printf("\nDISTINCTION IN ENGLISH");
}
if(b<=39)
{
printf("\nCOMPARTMENT IN ENGLISH");
}
if(c>=75)
{
printf("\nDISTINCTION IN HINDI");
}
if(c<=39)
{
printf("\nCOMPARTMENT IN HINDI");
}
///////////////////////////////////////////////////////////
}
else if(per>=60)
{
printf("\nGRADE C");
if(a>=75)
{
printf("\nDISTINCTION IN MATHS");
}
if(a<=39)
{
printf("\nCOMPARTMENT IN MATHS");
}
if(b>=75)
{
printf("\nDISTINCTION IN ENGLISH");
}
if(b<=39)
{
printf("\nCOMPARTMENT IN ENGLISH");
}
if(c>=75)
{
printf("\nDISTINCTION IN HINDI");
}
if(c<=39)
{
printf("\nCOMPARTMENT IN HINDI");
}
/////////////////////////////////////////////////////////////
}
else if(per>=50)
{
printf("\nGRADE D");
if(a>=75)
{
printf("\nDISTINCTION IN MATHS");
}
if(a<=39)
{
printf("\nCOMPARTMENT IN MATHS");
}
if(b>=75)
{
printf("\nDISTINCTION IN ENGLISH");
}
if(b<=39)
{
printf("\nCOMPARTMENT IN ENGLISH");
}
if(c>=75)
{
printf("\nDISTINCTION IN HINDI");
}
if(c<=39)
{
printf("\nCOMPARTMENT IN HINDI");
}
///////////////////////////////////////////////////
}
else if(per>=40)
{
printf("\nGRADE E");
if(a>=75)
{
printf("\nDISTINCTION IN MATHS");
}
if(a<=39)
{
printf("\nCOMPARTMENT IN MATHS");
}
if(b>=75)
{
printf("\nDISTINCTION IN ENGLISH");
}
if(b<=39)
{
printf("\nCOMPARTMENT IN ENGLISH");
}
if(c>=75)
{
printf("\nDISTINCTION IN HINDI");
}
if(c<=39)
{
printf("\nCOMPARTMENT IN HINDI");
}
//////////////////////////////////////////////////////////////
}
else
{
printf("\n\nFAIL");
}

printf("\n\npress n to close");
printf("\n\npress y to continue\n\n");
scanf(" %c",&ch);
if((ch=='y')||(ch=='Y'))
{
goto up;
}
}

CREATE A STOPWATCH IN C PROGRAM

#include<stdio.h>
#include<conio.h>
#include<dos.h>
void main()
{
int a=0,b=0,c=0;
up:
clrscr();
gotoxy(30,5);
printf("TIME");
gotoxy(30,10);
printf("%d:%d:%d",a,b,c);
delay(100);
c++;
if(c==59)
{
c=0;
b++;
}
if(b==59)
{
b=0;
a++;
}
if(a==13)
{
a=1;
}
if(!kbhit())
goto up;
}
Wait while more posts are being loaded