C Program to Make a Simple Calculator Using switch.case In this example, you will learn to create a simple calculator in C programming using the switch statement. To understand this example, you should have the knowledge of the following C programming topics: C switch Statement. May 04, 2016 Introduction to computer and programming-operators & operents. Hello friends, Today i am coming with one more interesting program.We will make scientific calculator using c. We will learn how to build scientific calculator in c. Functions of this calculator See more: Program for shutdown your pc 1. Arithmetic operations 2.Trigonometric operations 3.Power functions 4. Log functions Source code #include.
Originally released by Bloodshed Software, but abandoned in 2006, it has recently been forked by Orwell, including a choice of more recent compilers. It can be downloaded from:
http://orwelldevcpp.blogspot.com
Installation
Run the downloaded executable file, and follow its instructions. The default options are fine.Support for C++11
By default, support for the most recent version of C++ is not enabled. It shall be explicitly enabled by going to:Tools -> Compiler Options
Here, select the 'Settings' tab, and within it, the 'Code Generation' tab. There, in 'Language standard (-std)' select 'ISO C++ 11':
Ok that. You are now ready to compile C++11!
Compiling console applications
To compile and run simple console applications such as those used as examples in these tutorials it is enough with opening the file with Dev-C++ and hitF11
.As an example, try:
File -> New -> Source File
(or Ctrl+N
)There, write the following:
Then:
File -> Save As...
(or Ctrl+Alt+S
)And save it with some file name with a
.cpp
extension, such as example.cpp
.Now, hitting
F11
should compile and run the program.If you get an error on the type of
x
, the compiler does not understand the new meaning given to auto
since C++11. Please, make sure you downloaded the latest version as linked above, and that you enabled the compiler options to compile C++11 as described above.Tutorial
You are now ready to begin the language tutorial: click here!.
Nov 29, 2016 Delphi is the ultimate IDE for creating cross-platform, natively compiled apps. Are you ready to design the best UIs of your life? Our award winning VCL framework for Windows and FireMonkey (FMX) visual framework for cross-platform UIs provide you with the foundation for intuitive, beautiful.
A little calculator written in BCX basic and then translated to C code and modified to compile with Dev C++ (GCC/G++). Once you find your way past the standard GUI gibberish you can figure it out.
For those who need some hand holding with the Dev C++ IDE:
In the IDE go to FILE, then NEW, then Project, select Windows Application, give it a name like Calc1 then click OK. A filesave dialog box comes up, create a new folder, might as well call it Calc1, open it and save Calc1.dev there. The DevCpp IDE comes up with a bare bones template, select and delete that and cut and paste this code into the empty editor page. Now compile and run.
3,978 Views
For those who need some hand holding with the Dev C++ IDE:
In the IDE go to FILE, then NEW, then Project, select Windows Application, give it a name like Calc1 then click OK. A filesave dialog box comes up, create a new folder, might as well call it Calc1, open it and save Calc1.dev there. The DevCpp IDE comes up with a bare bones template, select and delete that and cut and paste this code into the empty editor page. Now compile and run.
Scientist
Narue,
see what you did?! This was my first snippet posted on DaniWeb because you wanted to know what BCX could do!
see what you did?! This was my first snippet posted on DaniWeb because you wanted to know what BCX could do!
vegaseat1,735
A note on header files, the good old workhorse for C++ is the iostream header file, but beware. The one that comes with DevCpp, and likely others too, is a monster. It itself includes other headers, which in turn include more headers and so on. If you follow the internal includes with an editor you find stdio.h and math.h are there too! The result seems to be a rather bloated executable file. So sometimes it is best and cut the middle-man, here iostream, and get a cute and tiny exe file. Just comment out the line
#define CPP_HEADER
#define CPP_HEADER
Found some time and was able to replace the iostream header. Now this baby has only a 16k footprint, like a little calculator should have.
Gary King37
[Linker error] undefined reference to `GetStockObject@4'
I get a bunch of errors when trying to Compile & Run this.
Dev C Calculator
What compiler are you using, and are you compiling this as a Windows Application?
TheEliteOne
I tried to compile that source code as a .cpp on the DevC++ compiler and I got a few errors, here is a picture of the errors that I got:
Please help, I would love to have this source code as an example, I am just now getting into GUI C++ Programming.
Standard Dev Calculator Excel
Thanks
EDIT:
Sorry for posting in a thread that hasn't had a post in 6 years lol..... didn't see it until I posted, but I hope that I could get an answer before a staff member 'fixes' this (As in closes it or deleted my post) if I can, thanks.
Calculator Code In Dev C++
Edited by TheEliteOne: n/a
plz i need a scinetific calculator in this code urgently
rproffitt1,693
To saqib_3. If you need something urgently, why bury it in a 12 year old discussion?