Professional Documents
Culture Documents
START
INSERT A KEY
CALL FOR
WORKSHOP
END
QUESTION 2
a. What is the suitable input for the problem?
The total remaining salary - tax
b. What will be the expected output?
The total of remaining salary after minus with tax
c. Write the pseudo code and construct the flow chart to solve
the problem.
PSEUDO CODE
1. Start / begin
2. Calculate the remaining salary
3. Subtract the remaining salary with tax
FLOW CHART
START
END
QUESTION 3
Create a flowchart to solve the problem.
START
CHECK
SELAMAT MALAM
SELAMAT PAGI
SELAMAT PETANG
END
QUESTION 4
a. Program A versus Program B
Program A
Source code
#include<stdio.h>
Int main 0
{
Int c=2, x;
x=2 + =c;
printf(%d\n,x);
return 0 ;
}
Output
>ch-uAB2.C
5
>Exit code : 6
Program B
Source code
#include <stdio.h>
int main ()
{
int c=2,x;
x=2 + c++;
printf (%\n,x);
return 0;
}
Output
>ch-uLAB2.C
4
>Exit code:0
Program C
Source code
#include <stdio.h>
int main()
{
int c=2,x;
x=2 + --c;
printf (%d\n,x);
return 0;
}
Output
>ch-uLAB2.C
3
>Exit code : 0
Program D
Source code
#include <stdio.h>
{
int c=2,x;
x=2 + c --;
printf (%d\n,x);
return 0;
}
Output
>ch-u<ab2.c
4
>Exit code :