0% found this document useful (0 votes)
9 views

C Program For Scientific Calculator: Mohammed Kaif 22K81A12G2

Uploaded by

mnaganikhith
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views

C Program For Scientific Calculator: Mohammed Kaif 22K81A12G2

Uploaded by

mnaganikhith
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 15

A

Project Report On

C program for Scientific calculator


Submitted for partial fulfilment of the requirement for the award of the degree of

BACHELOR OF TECHNOLOGY
in
INFORMATION TECHNOLOGY
by

Mohammed kaif - 22K81A12G2


Under the guidance of

Mr M.Manohar
ASSISTANT PROFESSOR

DEPARTMENT OF HUMANITIES AND SCIENCE ENGINEERING


St. MARTIN’S ENGINEERING COLLEGE

An autonomous Institute
NBA & NAC A+ Accredited

Dhulapally, Secunderbad-500100

ACADEMIC YEAR: 2022-23


St. MARTIN’S ENGINEERING COLLEGE
An autonomous Institute
NBA & NAC A+ Accredited

Dhulapally, Secunderbad-500100

CERTIFICATE

This is to certify the project entitled C program for Scientific calculator is being submitted

by Mohammed kaif - 22K81A12G2 in fulfilment of the requirement for the award

degree of BACHELOR OF TECHNOLOGY in INFORMATION TECHNOLOGY

is recorded of bonafide work carried out by them. The result embodied in thisreport have been

verified and found satisfactory.

Guide Head of the department

Mrs. M.Manohar Dr. Ranadheer Reddy M.Phil(Ph.D)


Assistant professor Professor and HOD

Internal Examiner External Examiner

i
St. MARTIN’S ENGINEERING COLLEGE
An autonomous Institute
NBA & NAC A+ Accredited
Dhulapally, Secunderabad-500100

DECLARATION

We, the students of “Bachelor of Technology in Department of Humanities and science ”,

session: 2022 – 2025, St. Martin’s Engineering College, Dhulapally, Kompally,Secunderabad,

hereby declare that the work presented in the Project Work entitled as (Title) is the outcome of

our own bonafide work and is correct to the best of our knowledge and this work has been

undertaken taking care of Engineering Ethics. This resultembodied in this project report has not

been submitted in any university for award of any degree.

Name: Mohammed kaif rollno: 22K81A12G2

ii
ACKNOWLEDGEMENT

We would like to be grateful to the Department of HUMANITIES AND SCIENCE


ENGINEERING . St.Martin’s Engineering College for giving us the opportunity to execute this
project, which is an integral part of the curriculum in B. Tech program of SMEC.

Our sincere thanks to Dr P. Santosh Kumar Patra, principal, St. Martin’s engineering
college, for giving this opportunity to carry out the present project work. We would like to take
this opportunity to express heartfelt gratitude for head of the department Dr. Ranadheer
Reddy, who provided us support and valuable inputs at various stages of this project work.

We would like to take this opportunity to express our sincere appreciation to all the people who
were helpful in making this project successful. First of all, we would like to express our
gratitude to our guide, Mrs. M.Manohar Assistant Professor, for her valuable comments,
guidance, and discussions that guided us well in the process of our project.

Finally, we express our sincere thanks to all teaching and non-teaching staff that guided and
helped us to complete the project work successfully.

Name : Mohammed Kaif rollno:22K81A12G2

iii
TABLE OF CONTENTS

TITLE PAGE NO

Acknowledgement iii
iv
Introduction
vi
Algorithm
vii
Flowchart
1
Source code
2
Expected output

3
4
5
6

iv
Introduction :
Introduction :
CREATING SCIENTIFIC CALCULATOR :
You have to need to creat scientific calculator class to perform task related to
scientific calculations. Which include finding square or cube etc.
The scientific calculator perform following task.
You have to need to creat scientific calculator class to perform task related to
scientific calculations. Which include finding square or cube etc.
The scientific calculator perform following task.
You have to need to creat scientific calculator class to perform task related to
scientific calculations. Which include finding square or cube etc.
The scientific calculator perform following task.
1. Determine the square of the number.
2. Determine the square root of the number
3. Determine the first number power of the second number
4. Determine the factorial of a number
5. Determine the sin, cos and tan value of the number.
6. Determine the logarithm, natural logarithm and exponential of the
number.
To perform the above mentioned task in scientific calculator implements the following
member function.

FUNCTION DESCRIPTION
Square accept a number and returns the square of the number
Squae root accept a number and returns the square root of number
v
Cube accept two number and returns the first power to 2nd num.
Fact returns a factorial of an input number.
Sin_fun returns the sin value of an input number.
Cos_fun return the cos value of an input number.
Tan_fun return the tan value of an input number
Log_fun return the log value of an input number
Log10_fun return the log10 value of an input number.
Exp_fun return the exp value of an input number.
FUNCTION DESCRIPTION
Square accept a number and returns the square of the number
Squae root accept a number and returns the square root of number
Cube accept two number and returns the first power to 2nd num.
Fact returns a factorial of an input number.
Sin_fun returns the sin value of an input number.
Cos_fun return the cos value of an input number.
Tan_fun return the tan value of an input number
Log_fun return the log value of an input number
Log10_fun return the log10 value of an input number.
Exp_fun return the exp value of an input number.

You have to need to creat scientific calculator class to perform task related to
scientific calculations. Which include finding square or cube etc.
The scientific calculator perform following task.
You have to need to creat scientific calculator class to perform task related to
scientific calculations. Which include finding square or cube etc.
The scientific calculator perform following task.
You have to need to creat scientific calculator class to perform task related to
vi
scientific calculations. Which include finding square or cube etc.
The scientific calculator perform following task.
You have to need to creat scientific calculator class to perform task related to
scientific calculations. Which include finding square or cube etc.
The scientific calculator perform following task.

Basically we all engineering students use a scientific calculator as our maths calculation
instrument
So what is a scientific calculator means ?
A scientific calculator is an electronic calculator, either desktop or handheld, designed to perform
mathematical operations. They have completely replaced slide rules and are used in both educational
and professional settings.

To know the process of the calculator working principle I choose the scientific calculator as my project work

We can make a simple calculator using C language by two approaches using switch case and if-else
statement. But to create a scientific calculator I used the switch case and break statement ;

As the below program (code ); has written by my self


And the program is capable to perform 22 different types of operations
The below code is tested as well :

vii
FLOWCHART :

viii
SOURCECODE:

// scientific calculator (MOHAMMED KAIF PPS PROJECTWORK )

#include<stdio.h>

#include<math.h>
int main(void) {
int choice, i, a, b;
float x, y, result;
do {
printf( "\n Select your operation (0 to exit):\n ");
printf("1. Addition\n 2. Subtraction\n 3. Multiplication\n 4. Division\n");
printf("5. Square root\n 6. X ^ Y\n 7. X ^ 2\n 8. X ^ 3\n");
printf("9. 1 / X\n 10. X ^ (1 / Y)\n 11. X ^ (1 / 3)\n");
printf("12. 10 ^ X\n 13. X!\n 14. %\n 15. log10(x)\n 16. Modulus\n");
printf("17. Sin(X)\n 18. Cos(X)\n 19. Tan(X)\n 20. Cosec(X)\n");
printf("21. Cot(X)\n 22. Sec(X)\n");
printf("Choice:");
scanf( "%d", &choice);
if(choice == 0) exit(0);
switch(choice) {
case 1:
printf("Enter X: ");
scanf( "%f", &x);
printf( "\nEnter Y: " );
scanf( "%f", &y);
result = x + y;
printf( "\n Result: %f", result);
break;
case 2:
printf("Enter X: ");
scanf("%f", &x);
printf( "\n Enter Y: ");
scanf("%f", &y);
result = x - y;
printf("\n Result: %f", result);
break;
case 3:
printf("Enter X: ");
scanf("%f", &x);
printf("\n Enter Y: ");
scanf("%f", &y);
result = x * y;
printf("\n Result: %f", result);
break;
case 4:
printf("Enter X: ");
scanf("%f", &x);
printf("\n Enter Y: ");
scanf("%f", &y);
result = x / y;
printf("\n Result: %f", result);

ix
break;
case 5:
printf("Enter X: ");
scanf("%f", &x);
result = sqrt(x);
printf("\n Result: %f", result);
break;
case 6:
printf("Enter X: ");
scanf("%f", &x);
printf("\n Enter Y: ");
scanf("%f", &y);
result = pow(x, y);
printf("\n Result: %f", result);
break;
case 7:
printf("Enter X: ");
scanf("%f", &x);
result = pow(x, 2);
printf(" \n Result: %f", result);
break;
case 8:
printf("Enter X: ");
scanf("%f", &x);
result = pow(x, 3);
printf("\n Result: %f", result);
break;
case 9:
printf("Enter X: ");
scanf("%f", &x);
result = pow(x, -1);
printf("\n Result: %f", result);
break;
case 10:
printf("Enter X: ");
scanf("%f", &x);
printf("\n Enter Y: ");
scanf("%f", &y);
result = pow(x, (1/y));
printf("\n Result: %", result);
break;
case 11:
printf("Enter X: ");
scanf("%f", &x);
y = 3;
result = pow(x, (1/y));
printf("\nResult: %f", result);
break;
case 12:
printf("Enter X: ");
scanf("%f", &x);
result = pow(10, x);
printf("\n Result: %f", result);
break;
case 13:

x
printf("Enter X: ");
scanf("%f", &x);
result = 1;
for(i = 1; i <= x; i++) {
result = result * i;
}
printf("\n Result: %.f", result);
break;
case 14:
printf("Enter X: ");
scanf("%f", &x);
printf("\n Enter Y: ");
scanf("%f", &y);
result = (x * y) / 100;
printf("\n Result: %.2f", result);
break;
case 15:
printf("Enter X: ");
scanf("%f", &x);
result = log10(x);
printf("\n Result: %.2f", result);
break;
case 16:
printf("Enter X: ");
scanf("%d", &a);
printf("\n Enter Y: ");
scanf("%d", &b);
result = a % b;
printf(" \n Result: %d", result);
break;
case 17:
printf("Enter X: ");
scanf( "%f", &x);
result = sin(x * 3.14159 / 180);
printf( " \n Result: %.2f", result);
break;
case 18:
printf("Enter X:");
scanf( "%f", &x);
result = cos(x * 3.14159 / 180);
printf(" \n Result: %.2f", result);
break;
case 19:
printf("Enter X: ");
scanf( "%f", &x);
result = tan(x * 3.14159 / 180);
printf(" \n Result: %.2f", result);
break;
case 20:
printf("Enter X:");
scanf("%f", &x);
result = 1 / (sin(x * 3.14159 / 180));
printf(" \n Result: %.2f", result);
break;
case 21:

xi
printf("Enter X:");
scanf("%f", &x);
result = 1 / tan(x * 3.14159 / 180);
printf( " \n Result: %.2f", result);
break;
case 22:
printf("Enter X: ");
scanf( "%f", &x);
result = 1 / cos(x * 3.14159 / 180);
printf( " \n Result: %.2f", result);
break;
default:
printf( " \n Invalid Choice! ");
}
} while(choice);
return
0;

xii
OUTPUT:

Select your operation (0 to exit):


1. Addition
2. Subtraction
3. Multiplication
4. Division
5. Square root
6. X ^ Y
7. X ^ 2
8. X ^ 3
9. 1 / X
10. X ^ (1 / Y)
11. X ^ (1 / 3)
12. 10 ^ X
13. X!
14. %
15. log10(x)
16. Modulus
17. Sin(X)
18. Cos(X)
19. Tan(X)
20. Cosec(X)
21. Cot(X)
22. Sec(X)
Choice:

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy