6/25/2014

FEP 1023 Intro. to Programming. Exercises for Array and Selection (if and switch)

1. Consider the following 1 dimensional array.
double N[4] ={1.5,5.5,4.8,0.1};
state the value for

I) N[0]
II) N[1]
III) N[2]

2. Consider the following Array.

int M[2][4] = {7,8,9,1,0,3,2,1};

state the value for

I) M[0][0]
II) M[0][1]
III) M[2][0]
IV) M[2][2]
V) M[2][3]


3. Change the following if statement code to switch statement

scanf("%d",&bulan);

if (bulan == 1)
printf("JANUARY");
else if (code == 2)
printf(”FEBRUARY”);
else if (code == 3)
printf(”MAC”);
else
printf(”Other than the first three month of the year”);

No comments:

Cara download Installer windows 10 dalam format ISO

1. Jika anda bercadang untuk download windows 10 melalui website rasmi windows - pilihan untuk download dalam format ISO tidak di berikan.  ...