Download as pdf or txt
Download as pdf or txt
You are on page 1of 18

Write menu driven C program to perform different

logical operations according to selected options from


menu.
A microproject submitted by
Maharashtra State board of technical education
A partial fulfilment of diploma in the
Electronic and Telecommunication

Submitted by

Miss: Khilare Pranali Sahdev. (23324)


Miss: Patil Sneha Sambhaji. (23346)

Under guidance of
Miss: N. P. Joshi

GOVERNMENT RESIDENCE WOMEN POLYTECHNIC,


TASGAON MANERAJURI ROAD TASGAON 416312
2023-2024

GRWPT
CERTIFICATE

This is to certify that Ms. Khilare Pranali Sahdev. Roll no:


23331. and Ms. Patil Sneha Sambhaji Roll No: 23332. of Second
Semester of Diploma in First year. Electronic and
Telecommunication Engineering in Government Residence
Woman Polytechnical Tasgaon. Institute (Institute Code: 1228) has
completed micro project title is Write menu driven C program to
perform different logical operations according to selected options
from menu. In Subject Workshop Practices for “C Programming
Language” (Subject Code 22218) For the Academic Year 2023 to
2024

Date: Miss: N. P. Joshi


Place: (Project Guide)

Mrs. S. U. Shinde Dr. S. A. Pardesi


(HOD) (Principal)

GRWPT
ACKNOWLEDGEMENT

It is my great pleasure to acknowledge my research Miss: N. P.


Joshi Lecturer in Electronics and telecommunication department,
Government Women Residence Polytechnic, Tasgaon who
introduced me to a fascinating realm of C programming. Her invaluable
guidance, constant inspiration, unending support helped me a lot to
focus my views in proper perspective. Her tireless enthusiasm has
always been a source of inspiration for me. My deepest personal regards
are due for her forever.

It is great privilege for me to express my sincere thanks to Dr.


S.A.Pardesi. In charge Principal Government Women Residence
Polytechnic Tasgaon for his valuable suggestions, and constant
encouragement for my project work.

I sincerely acknowledge the help and co-operation from teaching and


non-teaching staff of the Department of E&TC Engineering
Government Women Residence Polytechnic, Tasgaon.

GRWPT
Index

Sr.No Content Page No

1 Introduction and Aim 5 and 6

2 Literature Review and Proposed 7


Methodology and Resource Used

3 Use books and Action plan 7

4 Source code 8 to 12

Competency and screenshots 13 to 15

5 Actual Resource Used and Skill development and 16


output of projects

6 Skill developed 16

7 Output of Projects 16

8 Application of microproject 16

9 Area of future improvement 17

GRWPT
PART: A

A MICRO-PROJECT REPORT
Title of Micro-Project: Write menu driven C program to perform
different logical operations according to selected options from
menu.
INTRODUCTION
Menu – driven program C is a type of program in which various options are
provided to the user and some functionality is provided based on these options.
These programs are used to provide a simple yet effective user interface and
deliver the requested functionalities to the user. This article provides an
overview of menu – driven programs in C.
A menu – driven program is simply a program that provides a collection of
options to the user. Based on the choice of the user, a specific set of statements
is executed to provide a good user experience. Systems using menu – driven
programs have limited choices and are more user – centric than other kinds of
programs. Because of the limited and specified type of choice, these systems are
less prone to user errors and are more user – friendly than command-line
interfaces

GRWPT
AIM: Write menu driven C program to perform different logical operations
according to selected options from menu.

Course Outcome

• Performed menu driven C program to perform different logical operations


according to selected options from menu using turbo c ++

LITERATURE REVIEW:

C programming know as basic and base of programming language with respect to the use of
this language related a program that help with finding out numeric characteristic of the
number which are passed through this program. It identifies with imported logic
programmatic logic of identifying entered number is factorial, Prime or Even/Odd.

Types of number characteristics Logic


1. Factorial.
2. Prime.
3. Even or Odd.

PREPOSED METHODOLOGY

1. We selected the topic.


2. We discussed topic.
3. We collect the information about Perform C programming
4. We collect the information about numeric characteristic logical
operations.
5. We creating part A
6. We creating part B.
7. We shall represent our part A in front of teacher.

GRWPT
RESOURCES USED:

USED BOOK:
NAME OF SUBJECT NAME OF AUTHOR

C programming language Mahesh Gurunani

https://www.w3school.com

https://stackoverflow.com

ACTION PLAN: -

Sr.No. Details of activity Start Date End Date Name of


responsible team
members

1. Select topic of microproject All Members

2. Collect the information of part All Members


A in internet and reference book

3. Prepare part A All Members

4. Present part A to teacher All Members

5. Collect the information of B in All Members


internet and reference book

6. Perpare part B All Members

7. Summit the micro-project All Members

GRWPT
Source code:

#include<stdio.h>

int main()
{
printf("\n\n\t\t Write menu driven C program to perform different logical
operations according to selected options from menu. \n\n\n");

int choice, num, i;


unsigned long int fact;

while(1)
{
printf("1. Factorial \n");
printf("2. Prime\n");
printf("3. Odd\\Even\n");
printf("4. Exit\n\n\n");
printf("Enter your choice : ");
scanf("%d",&choice);

switch(choice)
{
case 1:
printf("Enter number:\n");
scanf("%d", &num);
fact = 1;
for(i = 1; i <= num; i++)
{
fact = fact*i;
}
printf("\n\nFactorial value of %d is = %lu\n\n\n",num,fact);
break;

case 2:
printf("Enter number:\n");
scanf("%d", &num);
if(num == 1)
printf("\n1 is neither prime nor composite\n\n");
for(i = 2; i < num; i++)

GRWPT
{
if(num%i == 0)
{
printf("\n%d is not a prime number\n\n", num);
break;
}

}
/*
Not divisible by any number other
than 1 and itself
*/
if(i == num)
{
printf("\n\n%d is a Prime number\n\n", num);
break;
}

case 3:
printf("Enter number:\n");
scanf("%d", &num);

if(num%2 == 0) // 0 is considered to be an even number


printf("\n\n%d is an Even number\n\n",num);
else
printf("\n\n%d is an Odd number\n\n",num);
break;

case 4:
printf("\n\n\t\t\tCoding is Fun !\n\n\n");
exit(0); // terminates the complete program execution
}
}
printf("\n\n\t\t\tCoding is Fun !\n\n\n");
return 0;
}

GRWPT
Program Screenshots:

GRWPT
GRWPT
Output:

GRWPT
PART: B

Importance of C programming.

One of the most significant features of C language is its support for


dynamic memory management (DMA). It means that you can utilize and
manage the size of the data structure in C during runtime. C also provides
several predefined functions to work with memory allocation.

• Competency

• Variables, data types, and operators in C.

• File handling and command line arguments.

• Arrays and character array in C.

• Pointers and linked lists.

• String handling functions.

• Stacks and queues data structure in C language.

GRWPT
Performing C programming using Turbo C ++ Application
Step 1: Open turbo C IDE (Integrated Development Environment), click
on File and then click on New

Step 2: Write menu driven C program to perform different logical operations


according to selected options from menu, that we created in the previously.

GRWPT
Step 3: Click on Compile menu and then on Compile option, or press the
keys press Alt + F9 to compile the code.

Step 4: Click on Run or press Ctrl + F9 to run the code. Yes, C programs are
first compiled to generate the object code and then that object code is Run.

Step 5: Output is here

GRWPT
Actual Resource Used:

• Laptop with Windows operating system installed.


• Storage of HDD with minimum of 126GB.
• RAM with 4GB and onwards.
• Turbo C ++ application
• Reference books for programming.

Skill development
• We are Skill developing to create a microproject on Microsoft Word.
• We are Skill developing use various types of tools are using
microproject.
• We are Skill development of group discussions.
• We also skill developing reading information about C programming.
Examples, (creating environment for C programming, logical and
arithmetic expressions use in programming, writing program then
compiling, debugging and executing.)
• We also skill developing how to solve errors occurred during
debugging of program.
• We also skill developing how to creating logical expression for
programming.
• We also skill developing how use declaration and data types.

Output of projects
Written menu driven C program to perform different logical operations
according to selected options from menu.
• To identify factorial number
• To identify Prime number
• To identify either given number is odd or even.

Application of this microproject


• With this micro project using c programming we can identify the any
number’s factorial value.
• We can identify any number’s prime value is composite or not
• We can identify that entered number by nature is even or odd.

GRWPT
• In this micro project we do not need to write any factorial, prime and
even or odd value program again and again.
• With option selection method its easy to use any option.

Area of future improvement

• This program has many future applications to be used on high scope.


• By making this program more useful with adding more options as per the use.
• This program can be extended for more over to solve more mathematical
expressions.
• This is a microproject with respect to we can use this program in any other C
programming mathematic expression solving project.

GRWPT
GRWPT

You might also like