PSPD Microprj
PSPD Microprj
Report
On
Microproject
Prepared By
Dhruva Tikhe – 06
Grisha Jadhav – 03
Pranav Wani – 07
Title: To Count the Number of Digits in an
Integer
Objectives: 1. To count how many digits are in the integer provided by the user
CO’s Achieved Refer Syllabus copy for CO’s
: 1. Design algorithm, flowchart and write pseudo code for given problem
statements.
1. Algorithm
2. Flowchart
3. Pseudocode
4. C Program
Program/Circu Printed program
it
Diagram/Block 1) Algorithm:
Diagram/Flow
Diagram: 1. Start.
2. Read a number from user.
3. Divide the number by 10.
4. Increase counter of the digits by 1.
5. Repeat the steps 3 and 4 until number is equal to zero.
6. Print the value of the counter.
7. End.
2) Flowchart:
3) Pseudocode:
Start
Number n
Initialize count to zero
Print ("Enter a number: ")
Read n
While (n !=0)
Calculate n = n/10
Calculate count++
End while loop
Print (“The number of digits is: ”)
Print count
End
4) C Code:
#include <stdio.h>
int main()
{
int n;
int count=0;
while(n!=0)
{
n=n/10;
count++;
}
printf("The number of digits in an integer is:
%d",count);
return 0;
}
Roll No. Regularity Understanding Understanding Skills Ethics Total
and the Objective of Procedure (10) (03) (20)
punctuality (02) (02)
(03)
Subject Teacher