عرض مشاركة واحدة
منتديات طلاب وطالبات جامعة الملك عبد العزيز منتديات طلاب وطالبات جامعة الملك عبد العزيز
قديم 11-01-2011, 07:22 AM   #1047

..همس..

جامعي

الصورة الرمزية ..همس..

 
تاريخ التسجيل: May 2009
نوع الدراسة: إنتظام
المستوى: متخرج
الجنس: أنثى
المشاركات: 19
افتراضي رد: [cpcs 202 - برمجة 1] لديك سؤال , شيء غير مفهوم ,,, تفضل هنا , موضوع مفيد

المشاركة الأصلية كتبت بواسطة ® βutteяfly aηgel«~. مشاهدة المشاركة
كود:
#include<stdio.h>
كود:
#include<conio.h>
#define max 40
void fill( int [],int );
void check_salary( int [], int [],int );
void display(int [],int );
void main()
{
int x[max],sal[max],age[max],no=6;
fill(x,no);
fill(sal,no);
fill(age,no);
display(x,no);
display(sal,no);
display(age,no);
check_salary(age,sal,no);
display(x,no);
display(sal,no);
display(age,no);
getch();
}
//=========================================================================
void fill(int x[max],int no )
{
for(int i=0;i<no;i++)
scanf("%d",&x[i]);
printf("\n");
}
//==========================================================================
void display(int x[max],int no)
{
for(int i=0;i<no;i++)
printf("%d\t",x[i]);
printf("\n");
}
//===========================================================================
void check_salary(int age[max],int sal[max],int no)
{
for(int i=0;i<no;i++)
if(age[i]>=60)
sal[i]=sal[i]/2;
}
تسلمي جزاك الله خير
بس اتوقع ناقص
مافيلو ميثودات
· Void get_data(int x[],int no);
// to read Id , Salary and Age from the user .
· Void check_salary( int Sal[], int Age[],int no);
//to check if the age >=60, then salary/2
· Void display(int ID[], int Sal[], int Age[],int no);
// print the array values after checking.

 

..همس.. غير متواجد حالياً   رد مع اقتباس