Professional Documents
Culture Documents
Dec20012: Programming Fundamentals
Dec20012: Programming Fundamentals
Dec20012: Programming Fundamentals
S1 /100
S2 /100
S3 /100
Answer: Answer:
Answer: Answer:
Answer: Answer:
#include <stdio.n>
int main()
{
int num = 10:
while (num > 0)
{
if (num = 5)
break;
printf("%f\n" num);
--num;
}
}
Modified the program in Practical Assignments 02 using combination of if and continue statement to
eliminate ONLY number 3 in the sequence of number at output display.
6
5
4
2
1
0
Complete the table below with the CORRECT Program Practical Assignment 04
value of sum and I based on program given
#include <stdio.h>
Table 1: The expected value sum and i for int main()
looping cycle in the C program practical {
assignment 04 int sum=0;
int i;
Value of sum Value of i for(int i = 0; i<=15; i++)
0 0 {
sum = sum+i;
if(i==10)
{
goto addition;
}
}
addition:
printf("%d", sum);
return 0;
}
What is the value i to becomes the program
stop and terminate the loop statement?
i =___________
Based on the C program given above (program practical assignment 04) manipulates these code to
produce the flowchart and display the output to represent it operation.
Practical Exercise 1
Manipulates Program 1: What is the output for the C statement below?. Based on that program build
the related flowchart that represent its operation.
Program 1
Answer flowchart:
Explanation: Give your explanation based on program given how do…while statement done its
operation in the program.
Answer explanation:
Answer 1 (Output):
Answer 2 (Explanation):
Answer 3 (Modify program):
Conclusion :