Draw a flow chart and write an algorithm for a programm that adds all 2 digit numbers divisible by 3.( Hint: these numbers are 12,15 till 99.you must use looping)
Answers
Answered by
10
Answer:
Algorithm:
Step 1: Input N // the number up to which we need to count , here it is 99
Step 2: Sum = 0
Step 3: for(i= 0;i<=N;i++)
Step 4: if ( i %3 == 0)
Sum = Sum + i;
}
Step 5: Print Sum
Flowchart:
Start -> Sum = 0 -> Read N -> i<=N-> if ( i %3 == 0)-> true->Sum = Sum + i-> i++-> Sum = Sum + i-> Print Sum |
v
false-> i++
Similar questions