Subscribe For Free Updates!

We'll not spam mate! We promise.

Showing posts with label programing. Show all posts
Showing posts with label programing. Show all posts

Wednesday, 6 April 2016

How to make a console calculator in programming in urdu

C language is a very famous language in the market. Everyone wants to learn C program because C language is an only one language which is the base of every successful programmer. Some days ago I have posted a complete course of C programming in Urdu and Hindi language. This course contains more than 25 video lectures. So you can watch this course. 

As I tell you that in the C programming course that first we learn about basic functionalities of C programming and then we will move on the projects section. So we have successfully completed our course and now the time is to move on the projects section. This is the first project of our course. In this project I will teach you that how you can easily make a console calculator. This calculator has complete functionalities like getting sum result, multiplication result, division result, and also subtraction result of any numbers.  

What is the functionalities of this calculator program

This calculator program can apply any function like plus, minus, multiply and divide. It collects three inputs from user on run time first input is “Value 1” and second input is “operation (plus minus etc)” and third is “value 2”.If the user enters the sign “+” then it will display the sum of both these values. Simply it depends on the mathematical operation which is enters by the user. If the user applies an invalid value then system performs beep sound. 

How to make this calculator?

1) Write the basic structure of C program.
2) Get three variables two integer and one character name as int value1, value2 and char operation.
3) Get input from the user by using printf() and scanf() function.
4) Start switch statement
5) Pass it the char variable “operation”.
6) Inside the curly braces write the below conditions.

switch(operation){
                                case '+':
                                                printf("The result is:%d",val1+val2);
                                break;        
                                case '-':
                                                printf("The result is:%d",val1-val2);
                                break;
                                case '*':
                                                printf("The result is:%d",val1*val2);
                                break;
                                case '/':
                                                printf("The result is:%d",val1/val2);
                                break;
                                default:
                                                printf("Invalid input!\a");
                                               
                }

After doing that compile your program and run. And your program it ready. Let’s use this program by performing different values and operation. And enjoy!

Watch This video How to make a console calculator in C programming

The source code of this program is:-

//This is a calculator program
#include<stdio.h>
#include<conio.h>
int main(){
                int val1,val2;
                char operation;
                printf("Enter value 1:");
                scanf("%d",&val1);
                printf("Enter operation:");
                scanf("%s",&operation);
                printf("Enter value 2:");
                scanf("%d",&val2);
               
                switch(operation){
                                case '+':
                                                printf("The result is:%d",val1+val2);
                                break;
                                case '-':
                                                printf("The result is:%d",val1-val2);
                                break;
                                case '*':
                                                printf("The result is:%d",val1*val2);
                                break;
                                case '/':
                                                printf("The result is:%d",val1/val2);
                                break;
                                default:
                                                printf("Invalid input!\a");
                                               
                }
getch();
}

I hope you enjoy this tutorial. If you have any question then please asks your question in comment box and we will reply you very soon. So at the end of this tutorial I will tell that please like comment and join our site for later updates and new tutorials. In some days I’m going to start a online money making course for everyone. So that’s why please join our site.

Monday, 7 March 2016

Learn C programming in Urdu/Hindi videos


        In this course we will learn everything about “C” language. After reading the upper definition of “C” language you know that this is very important language that’s why I’ll try to make this course interesting and easy to understand as possible. In this course we will make some Games in “C” language. 

What is “C” language?

“C” is programming language which is the mostly used by programmers. There are many programming languages Java, VB and many other languages but “C” is a very famous and powerful programming language. You can develop any desktop software using “C” language. Many software developed in “C” language like VLC media player, Photoshop, Coral draw and many other software. So this is a very good programming language. You can create any type of software using this language. “C” language is base of every successful programmer. If you are successfully learned “C” then you will be able to learn every type of language.

Brief history of “C” language.

       “C” is a popular high level language. It was developed by Dennis Ritchie at At&T Bell Laboratories in 1972. C language was derived for of an earlier programming language called B. The “C” language basically developed for writing programs under UNIX operating system. The flexibility of “C” made it famous in the market. The earlier version of “C” was known as K&R (Kernighan and Rirchie). The American National Standard Institute (ANSI) developed the standard version of language. This new version of the language provided many new functions which were not available in the earlier versions. 

Start learning

Making first program

Write the program below in your compiler. You can use Turbo C++ or you can use Dev C++.

#include<stdio.h>
#include<conio.h>
Void main(){
Printf(“azeemIT.blogspot.com”);
}
Output:  azeemIT.blogspot.com

 Detail: “#include<stdio.h>” and” #include<conio.h>” are the header file or libraries of “C”. “Void main()” is a function which is used for start a program the actual written in this function. Printf() is built -in keyword provided by “C” for print something (which is written in the double quotes) on the screen. And semicolon “;” is called statement terminator which is used for ending statement. This program is the basic structure of “C” program. You must have to write these line of codes before writing your actual program.

 Variable?

       A variable is a named memory location. It is used to store program’s input data and its computational result during execution of program. The value of a variable may change during the execution of program but the name of variable cannot be changed.

Example of variable:   roll_no = 10;

Remember: you cannot be able to use space between the name of variable. You can use underscore        and. And you can also not be able to start variable name with numbers and special                    characters.

Data types

           There are four types of data in “C”. Which are Integer, Float, Character (String) and Boolean. These data types are used to define a variable before using. You must have to define the data type of variable which you are going to use.

See the data types below

Integer: Integer data type is defined as “int”. By using this data type you can just store numerical date like 0,1,2,3,4,5. It means you can just store numbers. You cannot be able to store names and special character like $,&.

Example of integer:  int roll_no = 50;

Float: In float data type you can store floating point data like 14.5 and 2.0 etc. You can use this data type by “float”.
Example of Float:   float height = 5.6;
Character (string): Character data type is defined by word “char” in “C”. This data type is used for storing character data like name and special characters etc.
Example of character: char dollar = ‘$’;
Boolean: Boolean data type is used for writing storing true or falls conditions. It is defined by word “bool”.

Example:  bool condition = true;
Comparing operators“==”:  

       This symbol is used for comparing two things. This is used for check whether the given condition is equal to. In “C” programming single equal to is used for assign some value to a variable and double equal to is used for comparing two variables.
Some other comparing operators are below. I thing you know about these signs which are below.
“>”  “<”  “>=”  “=<”  “!=”
If statement
”If” statement is used for checking some condition. “If” statement is a very good functionality of “C” language. The syntax of “If” statement is below.
If(condition){
This part will execute when the condition is true.
}
“else” statement
“else” statement will be executed if the condition is falls. It means that we use this statement when the given condition will not satisfy. See example.
 int student_age = 20;
Example: if(student_age < 18 ){
 printf(“welcome”);
}else{
Printf(“Sorry you are over age!”);
}
Output: Sorry you are over age!
Detail: In the above program I give the condition that if the student age is less than 18 then print “Welcome” or if the student age is greater than 18 then print “Sorry you are over age”. So this is the use of “if” and “else” statements.

Watch these videos to understand complete course in practical

First video of this course [ Introduction ]



Click and watch complete course on youtube

Admin feedback 

         I hope you enjoy this course. In this course I was try my best to teach you very well as possible. So now I’m waiting of your good feedback. Your good comments give me a new hope then I will provide you GUI course in “C” language for free. I will also provide you tutorials about some interesting programs and games. As usual I asked you if you have any question then please write your question the comment box.


Saturday, 28 November 2015

How to install turbo C++ in urdu


What is Turbo C++ software?

Turbo C++ software is a compiler which is used to compile C/C++ programs. 

Watch this video "How to install Turbo C++"