#include
#include
void main()
{
////////////intger variable///////////////////
int m,n,d,y,md=0,x[20],day,week,yd,h;
/////////char varaiabel//////////////
char choice;
/////////TO ENTER MONTH BETWEEN 1========>12///////////////
start:
m=0;
y=0;
d=0;
md=0;
day=0;
yd=0;
cout<<"enter the date mm/dd/yyyy"< do{
if(n>0)
cout<<"enter the moth between (1and 12)"< cout<<"MM::";cin>>m;
n++;
}while(m>=1 && m>=13);
n=0;
////////////////////////////////////////////////////////////////////////
///////////////TO ENTER DAY////////////////////////////////////////////
switch(m)
{
case 1:
case 3:
case 5:
case 7:
case 8:
case 10:
case 12:cout<<"enter day between(1 and 31)"< do{
if(n>0)
cout<<"You must enter day between(1 and 31)"< cout<<"dd::";cin>>d;
n++;
}while(d>=1 && d>=32);
break;
////////////////////// DAY BETWEEN 1 AND31/////////////////////
//////////////////////ENTER DAY///////////////////////////////
case 4:
case 6:
case 9:
case 11:cout<<"entr day between(1 and 30)"< n=0;
do{
if(n>0)
cout<<"you must enter day between(1 and 30)"< cout<<"enter dd:"; cin>>d;
n++;
}while(d>=1 && d>=31);
n=0;
break;
////////////////////DAY BETWEEN 1 AND 30////////////////////////////
///////////////////////TO ENTER DAY FOR MONTH 2////////////////////////////////
case 2:cout<<"enter yaer"< do{
if(n>1)
cout<<"you must enter year between(1000 and 9999)"<
cout<<"enter yyyy:";cin>>y;
n++;
}while(y<=1000 && y<=9999);
n=0;
if((y%4)==0)
{
cout<<"enter day between(1 && 29)"< do{
if(n>0)
cout<<"you must enter day between(1 and 29)"< cout<<"Enter dd:";cin>>d;
n++;
}while(d>=1 && d>=30);
n=0;
}
else
{
cout<<"enter day between(1 && 28)"< do{
if(n>0)
cout<<"you must enter day between(1 and 29)"< cout<<"Enter dd:";cin>>d;
n++;
}while(d>=1 && d>=29);
////////////DAY BETWEEN 1 AND 28 OR 1 AND 29/////////////////////
}
break;
}//////////END OF SWITCH////////////////////////////////////////////////////
//////////////////////ENTER YAER FOR MONTH NOT EQUAL 2/////////////////////
if(m!=2)
{
cout<<"enter yaer"< do{
if(n>1)
cout<<"you must enter year between(1000 and 9999)"<
cout<<"enter yyyy:";cin>>y;
n++;
}while(y<=1000 && y<=9999);
n=0;
}
//////////////////////END OF ENTER DAY,MOTH AND YEAR/////////////////////
////////////////////////////////////////////////////////////////////////
/////////////ASSUME STANDER DATE 01/01/2000,SATRDAY////////////////////
////////////////////////DAY OF ALL MONTH//////////////////////////////
for(int i=0;i<=12;i++)
{
if(i==0)
x[i]=0;
else if(i==1 || i==3 || i==5 || i==7 ||i==8 || i==10 || i==12)
x[i]=31;
else if(i==4 || i==6 || i==9 || i==11 )
x[i]=30;
else if(i==2)
x[i]=28;
}
/////////////////////////////////////////////////////////////////////////
////////////// FOR YEAR GREAT THAN 2000//////////////////////////////////
//////////////CONVER YEAR AND MONTH TO DAY/////////////////////////////////////////
if(y>2000)
{
h=0;
int yd=((y-2000)*365);
/////////////////////////////////////////////////////////////////////////
///////////CONVER MONTH TO DAY//////////////////////////////////////////
for(i=1;i md+=x[i];
///////////////////////////////////////////////////////////////////////
////////CONVER DATE TO DAY////////////////////////////////////////////
day=yd+md+d;
/////////////////////////////////////////////////////////////////////
/////ADD DAY FOR YEAR/////////////////////////////////////////////////
if((y%4)==0)
if(m>2)
day++;
for(i=1;i<(y-2000);i++)
{
if((i%4)==0)
day++;
}
}
////////////////////////////////////////////////////////////////////////////
////////////// FOR YEAR EQUAL 2000/////////////////////////////////////////
else if(y== 2000)
{
h=0;
for(i=1;i md+=x[i];
day=md+d;
}
//////////////////////////////////////////////////////////////////////////
////////////////CONVER DAY TO WEEK///////////////////////////////////////
if(h==0)
{
week=day%7;
switch(week)
{
case 0:cout<<"****************************************************"< cout<<"************DATE::"<<"SAT--"< cout<<"****************************************************"< break;
case 1: cout<<"****************************************************"< cout<<"************DATE::"<<"SUN--"< cout<<"****************************************************"< break;
case 2: cout<<"****************************************************"< cout<<"************DATE::"<<"MON--"< cout<<"****************************************************"< break;
case 3: cout<<"****************************************************"< cout<<"************DATE::"<<"TUE--"< cout<<"****************************************************"< break;
case 4:cout<<"****************************************************"< cout<<"************DATE::"<<"WED--"< cout<<"****************************************************"< break;
case 5: cout<<"****************************************************"< cout<<"************DATE::"<<"THU--"< cout<<"****************************************************"< break;
case 6: cout<<"****************************************************"< cout<<"************DATE::"<<"FRI--"< cout<<"****************************************************"< break;
cout<<"T"< }
}
////////////////////////////////////////////////////////////////////////////
///////////FOR YEAR LESS THAN 2000/////////////////////////////////////////
day=0;
if(y<2000)
{
////////////CONVER YEAR TO DAY////////////////////////////////////
yd=(2000-y)*365;
///////////CONVER MONTH TO DAY//////////////////////////////////
for(i=1;i md+=x[i];
if((y%4)==0)
{
if(m<3){md++;}
}
//////////////////////////////////////////////////////////////
/////////////ADD DAY TO DAY//////////////////////////////////
for(i=(2000-y);i>0;i--)
{
if((i%4)==0)
yd++;
}
if((y%4)==0)
{ yd++;}
day=yd-md-d+1;
/////////////CONVER DAY TO WEEK////////////////////
week=day%7;
cout<<"E"< switch(week)
{
case 0:cout<<"****************************************************"< cout<<"************DATE::"<<"SAT--"< cout<<"****************************************************"< break;
case 1: cout<<"****************************************************"< cout<<"************DATE::"<<"FRI--"< cout<<"****************************************************"< break;
case 2: cout<<"****************************************************"< cout<<"************DATE::"<<"THU--"< cout<<"****************************************************"< break;
case 3: cout<<"****************************************************"< cout<<"************DATE::"<<"WED--"< cout<<"****************************************************"< break;
case 4:cout<<"****************************************************"< cout<<"************DATE::"<<"TUE--"< cout<<"****************************************************"< break;
case 5: cout<<"****************************************************"< cout<<"************DATE::"<<"MON--"< cout<<"****************************************************"< break;
case 6: cout<<"****************************************************"< cout<<"************DATE::"<<"SUN--"< cout<<"****************************************************"<
}
///////////////TO TRY AGIN OR EXIT/////////////////////////////////
}
do
{
if(i>0)
cout<<"YOU MUST ENTER Y OR N::"< cout<<"TO CONTINUO PRESS Y:"< cout<<"TO END PRESS N:"< cout<<"ENTER YOUR CHOICE(Y OR N)::";cin>>choice;
if(choice=='y')
goto start;
else if(choice=='n')
goto end;
}while(choice=='y' && choice=='n');
end:;
}
---------------------------------------------------------------------------------------
البرنامج الثانى :- بسيط وهو انك تكتب اسمك فى الخانة اللى كاتب فيها اسمى ويبدا الاسم متحرك
الكود :-
---------------------------------------------------------------------------------------
#include
#include
void main()
{
int i;
for(i=0;i<=320;i++)
{
gotoxy(i,220);
printf("elzaeem");
gotoxy(i-1,220);
delay(100);
printf(" ");
delay(100);
}
getch();
}
---------------------------------------------------------------------------------------
البرنامج الثالث :-
عبارة عن اسم متخرك بالصوت البينق
الكود:-
------------
#include
int main()
{
int i;
for(i=100;i<=200;i++)
{ gotoxy(i,10);
printf(" welcome people i hope u like this by elzaeem");
sound(i);
delay(100);
unsound();
}
return 0;
}
---------------------------------------------------------------------------------------
البرنامج الرابع:-
برنامج الة حاسبة تقوم بالعمليات الحسابية الاربعة
الكود:-
---------------------------------------------------------------------------------
#include
#include
main()
{
clrscr();
int choice ;
float a, b, result ;
cout << "Please enter a number : " ;
cout << "\n (1) add the numbers" ;
cout << "\n (2) subtract the numbers" ;
cout << "\n (3) multiply the numbers" ;
cout << "\n (4) devides the numbers\n " ;
cin >> choice ;
if( (choice>4) || (choice<1) )
{
cout << "\t\t *** Wrong input *** " ;
goto exit ;
}
cout << "Please enter the two numbers (a, and b) : " ;
cin >> a>> b ;
switch(choice)
{
case 1:
result = a+ b ;
cout << a<< " + "<< b<< " = "<< result ;
break ;
case 2:
result = a- b ;
cout << a<< " - "<< b<< " = "<< result ;
break ;
case 3:
result = a* b ;
cout << a<< " * "<< b<< " = "<< result ;
break ;
case 4:
result = a/ b ;
cout << a<< " / "<< b<< " = "<< result ;
break ;
} getch();
exit:
}
--------------------------------------------------------------------------------------
البرنامج الخامس:-
برنامج الساعة
الكود:-
---------------------------------------------------------------------------------------
#include
#include
main()
{
clrscr();
int choice ;
float a, b, result ;
cout << "Please enter a number : " ;
cout << "\n (1) add the numbers" ;
cout << "\n (2) subtract the numbers" ;
cout << "\n (3) multiply the numbers" ;
cout << "\n (4) devides the numbers\n " ;
cin >> choice ;
if( (choice>4) || (choice<1) )
{
cout << "\t\t *** Wrong input *** " ;
goto exit ;
}
cout << "Please enter the two numbers (a, and b) : " ;
cin >> a>> b ;
switch(choice)
{
case 1:
result = a+ b ;
cout << a<< " + "<< b<< " = "<< result ;
break ;
case 2:
result = a- b ;
cout << a<< " - "<< b<< " = "<< result ;
break ;
case 3:
result = a* b ;
cout << a<< " * "<< b<< " = "<< result ;
break ;
case 4:
result = a/ b ;
cout << a<< " / "<< b<< " = "<< result ;
break ;
} getch();
exit:
}
---------------------------------------------------------------------------------------
السادس:-
يقوم باظهار نص فقط لاغير واظن ان معظمكم عارفينة
الكود:-
---------------------------------------------------------------------------------------
#include
int main()
{
cout<<"How are You?"< return 0;
}
#include
void main()
{
////////////intger variable///////////////////
int m,n,d,y,md=0,x[20],day,week,yd,h;
/////////char varaiabel//////////////
char choice;
/////////TO ENTER MONTH BETWEEN 1========>12///////////////
start:
m=0;
y=0;
d=0;
md=0;
day=0;
yd=0;
cout<<"enter the date mm/dd/yyyy"<
if(n>0)
cout<<"enter the moth between (1and 12)"<
n++;
}while(m>=1 && m>=13);
n=0;
////////////////////////////////////////////////////////////////////////
///////////////TO ENTER DAY////////////////////////////////////////////
switch(m)
{
case 1:
case 3:
case 5:
case 7:
case 8:
case 10:
case 12:cout<<"enter day between(1 and 31)"<
if(n>0)
cout<<"You must enter day between(1 and 31)"<
n++;
}while(d>=1 && d>=32);
break;
////////////////////// DAY BETWEEN 1 AND31/////////////////////
//////////////////////ENTER DAY///////////////////////////////
case 4:
case 6:
case 9:
case 11:cout<<"entr day between(1 and 30)"<
do{
if(n>0)
cout<<"you must enter day between(1 and 30)"<
n++;
}while(d>=1 && d>=31);
n=0;
break;
////////////////////DAY BETWEEN 1 AND 30////////////////////////////
///////////////////////TO ENTER DAY FOR MONTH 2////////////////////////////////
case 2:cout<<"enter yaer"<
if(n>1)
cout<<"you must enter year between(1000 and 9999)"<
cout<<"enter yyyy:";cin>>y;
n++;
}while(y<=1000 && y<=9999);
n=0;
if((y%4)==0)
{
cout<<"enter day between(1 && 29)"<
if(n>0)
cout<<"you must enter day between(1 and 29)"<
n++;
}while(d>=1 && d>=30);
n=0;
}
else
{
cout<<"enter day between(1 && 28)"<
if(n>0)
cout<<"you must enter day between(1 and 29)"<
n++;
}while(d>=1 && d>=29);
////////////DAY BETWEEN 1 AND 28 OR 1 AND 29/////////////////////
}
break;
}//////////END OF SWITCH////////////////////////////////////////////////////
//////////////////////ENTER YAER FOR MONTH NOT EQUAL 2/////////////////////
if(m!=2)
{
cout<<"enter yaer"<
if(n>1)
cout<<"you must enter year between(1000 and 9999)"<
cout<<"enter yyyy:";cin>>y;
n++;
}while(y<=1000 && y<=9999);
n=0;
}
//////////////////////END OF ENTER DAY,MOTH AND YEAR/////////////////////
////////////////////////////////////////////////////////////////////////
/////////////ASSUME STANDER DATE 01/01/2000,SATRDAY////////////////////
////////////////////////DAY OF ALL MONTH//////////////////////////////
for(int i=0;i<=12;i++)
{
if(i==0)
x[i]=0;
else if(i==1 || i==3 || i==5 || i==7 ||i==8 || i==10 || i==12)
x[i]=31;
else if(i==4 || i==6 || i==9 || i==11 )
x[i]=30;
else if(i==2)
x[i]=28;
}
/////////////////////////////////////////////////////////////////////////
////////////// FOR YEAR GREAT THAN 2000//////////////////////////////////
//////////////CONVER YEAR AND MONTH TO DAY/////////////////////////////////////////
if(y>2000)
{
h=0;
int yd=((y-2000)*365);
/////////////////////////////////////////////////////////////////////////
///////////CONVER MONTH TO DAY//////////////////////////////////////////
for(i=1;i
///////////////////////////////////////////////////////////////////////
////////CONVER DATE TO DAY////////////////////////////////////////////
day=yd+md+d;
/////////////////////////////////////////////////////////////////////
/////ADD DAY FOR YEAR/////////////////////////////////////////////////
if((y%4)==0)
if(m>2)
day++;
for(i=1;i<(y-2000);i++)
{
if((i%4)==0)
day++;
}
}
////////////////////////////////////////////////////////////////////////////
////////////// FOR YEAR EQUAL 2000/////////////////////////////////////////
else if(y== 2000)
{
h=0;
for(i=1;i
day=md+d;
}
//////////////////////////////////////////////////////////////////////////
////////////////CONVER DAY TO WEEK///////////////////////////////////////
if(h==0)
{
week=day%7;
switch(week)
{
case 0:cout<<"****************************************************"<
case 1: cout<<"****************************************************"<
case 2: cout<<"****************************************************"<
case 3: cout<<"****************************************************"<
case 4:cout<<"****************************************************"<
case 5: cout<<"****************************************************"<
case 6: cout<<"****************************************************"<
cout<<"T"<
}
////////////////////////////////////////////////////////////////////////////
///////////FOR YEAR LESS THAN 2000/////////////////////////////////////////
day=0;
if(y<2000)
{
////////////CONVER YEAR TO DAY////////////////////////////////////
yd=(2000-y)*365;
///////////CONVER MONTH TO DAY//////////////////////////////////
for(i=1;i
if((y%4)==0)
{
if(m<3){md++;}
}
//////////////////////////////////////////////////////////////
/////////////ADD DAY TO DAY//////////////////////////////////
for(i=(2000-y);i>0;i--)
{
if((i%4)==0)
yd++;
}
if((y%4)==0)
{ yd++;}
day=yd-md-d+1;
/////////////CONVER DAY TO WEEK////////////////////
week=day%7;
cout<<"E"<
{
case 0:cout<<"****************************************************"<
case 1: cout<<"****************************************************"<
case 2: cout<<"****************************************************"<
case 3: cout<<"****************************************************"<
case 4:cout<<"****************************************************"<
case 5: cout<<"****************************************************"<
case 6: cout<<"****************************************************"<
}
///////////////TO TRY AGIN OR EXIT/////////////////////////////////
}
do
{
if(i>0)
cout<<"YOU MUST ENTER Y OR N::"<
if(choice=='y')
goto start;
else if(choice=='n')
goto end;
}while(choice=='y' && choice=='n');
end:;
}
---------------------------------------------------------------------------------------
البرنامج الثانى :- بسيط وهو انك تكتب اسمك فى الخانة اللى كاتب فيها اسمى ويبدا الاسم متحرك
الكود :-
---------------------------------------------------------------------------------------
#include
#include
void main()
{
int i;
for(i=0;i<=320;i++)
{
gotoxy(i,220);
printf("elzaeem");
gotoxy(i-1,220);
delay(100);
printf(" ");
delay(100);
}
getch();
}
---------------------------------------------------------------------------------------
البرنامج الثالث :-
عبارة عن اسم متخرك بالصوت البينق
الكود:-
------------
#include
int main()
{
int i;
for(i=100;i<=200;i++)
{ gotoxy(i,10);
printf(" welcome people i hope u like this by elzaeem");
sound(i);
delay(100);
unsound();
}
return 0;
}
---------------------------------------------------------------------------------------
البرنامج الرابع:-
برنامج الة حاسبة تقوم بالعمليات الحسابية الاربعة
الكود:-
---------------------------------------------------------------------------------
#include
#include
main()
{
clrscr();
int choice ;
float a, b, result ;
cout << "Please enter a number : " ;
cout << "\n (1) add the numbers" ;
cout << "\n (2) subtract the numbers" ;
cout << "\n (3) multiply the numbers" ;
cout << "\n (4) devides the numbers\n " ;
cin >> choice ;
if( (choice>4) || (choice<1) )
{
cout << "\t\t *** Wrong input *** " ;
goto exit ;
}
cout << "Please enter the two numbers (a, and b) : " ;
cin >> a>> b ;
switch(choice)
{
case 1:
result = a+ b ;
cout << a<< " + "<< b<< " = "<< result ;
break ;
case 2:
result = a- b ;
cout << a<< " - "<< b<< " = "<< result ;
break ;
case 3:
result = a* b ;
cout << a<< " * "<< b<< " = "<< result ;
break ;
case 4:
result = a/ b ;
cout << a<< " / "<< b<< " = "<< result ;
break ;
} getch();
exit:
}
--------------------------------------------------------------------------------------
البرنامج الخامس:-
برنامج الساعة
الكود:-
---------------------------------------------------------------------------------------
#include
#include
main()
{
clrscr();
int choice ;
float a, b, result ;
cout << "Please enter a number : " ;
cout << "\n (1) add the numbers" ;
cout << "\n (2) subtract the numbers" ;
cout << "\n (3) multiply the numbers" ;
cout << "\n (4) devides the numbers\n " ;
cin >> choice ;
if( (choice>4) || (choice<1) )
{
cout << "\t\t *** Wrong input *** " ;
goto exit ;
}
cout << "Please enter the two numbers (a, and b) : " ;
cin >> a>> b ;
switch(choice)
{
case 1:
result = a+ b ;
cout << a<< " + "<< b<< " = "<< result ;
break ;
case 2:
result = a- b ;
cout << a<< " - "<< b<< " = "<< result ;
break ;
case 3:
result = a* b ;
cout << a<< " * "<< b<< " = "<< result ;
break ;
case 4:
result = a/ b ;
cout << a<< " / "<< b<< " = "<< result ;
break ;
} getch();
exit:
}
---------------------------------------------------------------------------------------
السادس:-
يقوم باظهار نص فقط لاغير واظن ان معظمكم عارفينة
الكود:-
---------------------------------------------------------------------------------------
#include
int main()
{
cout<<"How are You?"<
}