إلي يقدر يساعدني يدش ابلييز

صباحووو

كيف الحال ...؟؟؟

انا عندي اسايمنت لسي بروجرام وماعرف احله ...

وبليييييز الي يعرف في البرنامج يدش ويفيدني ...لانه الاسايمنت يريده المدرس بالسبت ...​





هذه اهيه الاسئلة :

1)find one sample program of 2- dimensional array in C. then give short description of what the program is doing .

2) what do you mean by calling a function by reference ?

3) what are structures & how is it used in Cprogram? Give one sample program and show the output?

4)what are pointers? Give one sample program and show the output .





انا انتضر ردودكم ...
 
اختي ممكن تعدلي السوال الاول,,



2what do you mean by calling a function by reference



calling by reference to some variable ,this reference to a vairable can be obtained by preceding the identifier of a variable with an ampersand

sign(&) known as reference operator and which can be literally translated as "address of



بشرح لك بالعربي عشان توصل المعلومه by ereference يعني اعادة القيمة نفسها مهما صارت العمليه فالنهاية الناتج يكون نفسه في الي هو معرف فالبداية



مثلا :



y=5

x=3

y=x+3



والناتج راح يكون y=5 ماراح تتغير....



3) what are structures & how is it used in Cprogram? Give one sample program and show the output?



a structure is a collection of one or more variable type...



والستراكتشر عده انواع حددي لي اي نوع بتي وبكتب لك البرنامج

فيه اللي يخص



array

sequence strcture

repetition structure

selection structure

حددي اي ستراكشر تقصدي؟؟؟



what are pointers? Give one sample program and show the output



pointers is a variable that stores the reference to another variable ..

and it is a vary powerful feature of c language that has many uses in advanced programming



my first pointer //

#include<iostream.h>

Int main()

{

Int firstvalue,seconedvalue:

Int*mypointer;

Mypointer=&firstvalue;

*mypointer=10;

Mypointer=&seconedvalue;

*mypointer=20;

Cout<<"firstvalue is"<<firstvalue<<endl;

Cout<<"secondvalue is"<<secondvalue<<endl;

Return 0;}
 
مشكوره خيتو على المرور ...





في السؤال الثالث مب محددلنا شي ...يعني المدرس مخلي السوال عام ...




find one sample program of 2- dimensional array in C. then give short description of what the program is doing





what do you mean by calling a function by reference -







what are structures & how is it used in Cprogram? Give one sample program and show the output









what are pointers? Give one sample program and show the output



هذه السئلة مثل المدرسة عاطنا اياهن ...
 
find one sample program of 2- dimensional array in C. then give short description of what the program is doing



We can enter 2 D array of6*6 elements(36 elements in array)

#include<iostream.h>

Int maun()

{ int sum=0;

Int I,j;

/*Cout<<"enter 6*6 integer array element:(mean 36 element)"<<endl;

For(i=0;<=5;i++)

For(j=0;j<=5;j++)

Cin>>a[j];*/

Int a[6][6]={1,2,3,4,5,6,7,8,9,1,2,3,4,5,6,7,8,9,1,2,3,4,5,6,7,8,9,1,2,3,4,5,6,7,8,9}

For(i=0;i<=5;i++)

For(j=0;j<=5;j++)

If(i==j)

Sum=sum+a[j];

Cout<<"the summation of the primaty diagonal="<<sum<<endl;

Sum=0;

For(i=0;i<=4;i++)

For(j=i+1;j<=5;j++)

Sum=sum+a[j];

Cout<<"the summation of upper traianglar matrix is="<<sum<<endl;

Sum=0;

For(i=5;i>=1;i--)

For(j=i-1;j>=0;--)

Sum=sum+a[j];

Cout<<"the summation of lower traianglar matrix is="<<sum<<endl;

Return 0;

}

After run the program the results is

the summation of the primary diagonal =30

the summation of upper traianglar matrix is=73

the summation of lower traianglar matrix is

2 D array like this

6 5 4 3 2 1

3 2 1 9 8 7

9 8 7 6 5 4

6 5 4 3 2 1

3 2 1 9 8 7

9 8 7 6 5 4





اختي اول شي سوي له كوبي وبيست فالورد عشان يطلع عدل لانه مكان الفواصل والعمليات متلخبط في المنتدى,,
 
أعلى