L3-L5 Algorithm, Flowchart
L3-L5 Algorithm, Flowchart
L3-L5
Review
✓Problem solving
• Simple C programs
Step1: Start
Step 2: Input N
Step 3: fact 1
Step 4: for count=1 to N in step of 1 do
begin
factfact*count
end
Step 5: Print ‘fact of N=‘, fact
Step 6: [End of algorithm]
Stop
Step1: Start
Step 2: Input data
Step 3: factorial 1
Step 4: for i=1 to N in step of 1 do
begin
factorialfactorial*i
end
Step 5: Print ‘fact of N=‘, factorial
Step 6: [End of algorithm]
Stop
✓Easier to understand and analyze the problem and it’s solution before
programming
✓Machine independent
• Algorithm
• Flowchart
• Code
• Documenting
Similarly, the format specifiers are used with printf( ) function for printing/displaying.
27-02-2023 CSE 1071 Problem Solving using Computers (PSUC) - 2022 34
Input/ Output functions
• C provides the printf( ) to display the data on the output device
(monitor).
✓Program structure
✓Formatting
✓Input / Output
✓Simple C programs