مســـــــآءكم ذكر ,,
كالعاده هذا سؤالين الاول حليته بس يطلع عندي خطأ وتفضلووو هذا السؤال..
اقتباسWrite a program that reads date in first format and prints that data in the second format.You program should contain function convert_month that converts the month and prints the date in the new format.
21/7/2005
July 21,2005
وهذي محـــــاولتي ,,.
ممكن توضحون لي ايش سبب الخطأ..
#include<iostream>
using namespace std;
int day,month,year;
void convert_month()
{
cout<<"enter the date";
cin>>day>>month>>year;
switch(month)
{
case (1):
cout<<"January";
break;
case(2):
cout<<"Febraury";
break;
case(3):
cout<<"March";
break;
case(4):
cout<<"April";
break;
case(5):
cout<<"May";
break;
case(6):
cout<<"June";
break;
case(7):
cout<<"July";
break;
case(8):
cout<<"August";
break;
case(9):
cout<<"September";
break;
case(10):
cout<<"October";
break;
case(11):
cout<<"November";
break;
case(12):
cout<<"December";
break;
}
}
int main()
{
cout<<convert_month()<<day<<","<<year;// الخطأ في هالجمله..
return 0;
}وهذا السؤال الثاني ابد ماوصلت لطريقه لحله فياليت احد يشرح لي طريقة الحل وانا أطبق ,,
اقتباسWrite C++ program that uses a function power ( ) which gets the base and the exponent as parameters and return the x raised to the power n . Assume the exponent as positive integer .For example , power (3,4)=3*3*3*3
ولــــــكم خآآآآآلص الوود والنقاااء ,,.
