0% found this document useful (0 votes)
11 views10 pages

PSPD Microprj

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views10 pages

PSPD Microprj

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 10

School of Polytechnic and Skill Development

Integrated B.Tech Computer Engineering


Trimester – VI

Course: Problem Solving and Program


Design

Report
On
Microproject

Program to Count the


Number of Digits in an Integer

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.

2. Use basic ‘C’ data concepts for given problem statements.

3. Design algorithms and Develop C programs using selection structures. -


Design algorithms and Develop C programs using Loops
Description: Steps followed

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;

printf("Enter a number: ");


scanf("%d",&n);

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

You might also like