UPDATED:

How To Make A Simple Calculator By C Happy Coding.......... Happy Coding.......... Happy Coding.......... Happy Coding.......... Happy Coding.......... Happy Coding.......... Happy Coding.......... Happy Coding.......... Happy Coding.......... Happy Coding.......... Happy Coding.......... Happy Coding.......... This blog is under construction!!!!
Namecheap.com

Friday, February 26, 2016

DATA TYPE,VARIABLES,INPUT AND OUTPUT

DATATYPE: C has five types of basic Data.such as int,double,float,char and void.Today we are going to learn int Type data programming.int stand for integer.Integers are 0,1,2,3......

VARIABLES: A variable is nothing but a name given to a storage area that our programs can manipulate. Each variable in C has a specific type, which determines the size and layout of the variable's memory; the range of values that can be stored within that memory; and the set of operations that can be applied to the variable.




The name of a variable can be composed of letters, digits, and the underscore character. It must begin with either a letter or an underscore.Upper and lowercase letters are distinct because C is case-sensitive.
Now write this program on your compiler:

code:

           #include <stdio.h>

           int main()
           {
               int x,y;
               x = 5;
               y = 6;

               printf("%d",x);

           return 0;
           }

Output: 5



Description of the program: Here i wrote int x,y;int stand for integer and here i declared two variables x & y.You can declare many variables.You can not write variables like 1x,$a,#x,+y,show-ans etc.You can use this operators or signs or numbers (1,$,+,#) after characters.And you can use show_ans.
In printf function i used "%d" for showing integer which i mentioned after it.

Can you do summation,subtraction,multiplication and division by C?See in my next post.
Thanks for being with coder mania BD.

First program in C

We are going to write our first program in C a compiler.I write a program like this:

Code:

/*This is our first program.*/

#include <stdio.h> 


int main()         

{
    printf("Hello Worid.");
    
return 0;
}

Output is: Hello World.

coder mania bd

When i run this program it shows me "Hello World".

Why and How it works?

At first i wrote a comment between /*.......*/.The compiler do not read any comment in a program.You can write comment in a program for making a program easily readable to others or our next development.You can write single line comment and multi-line comment.For single line comment you have to use // this and for multi-line comment you have to use /*........*/ this.

After that we used #include <stdio.h>.#include means i linked something in this program from C library.Actually i linked a header file.C has many header file.All file have specific uses.The <stdio.h> file is for input and output operation.<std(standard)i(input)o(output).h(header)> .

Then i wrote int main().int means integer and the main() is a function.C has many functions but main() is the principle function for C language.

{...statements.....},The second brackets keep the statements.printf("Hello Worid."); this is a statement.Every statement must have to end with ; semicolon.

Now printf("Hello World."); printf is a function.It helps the program to give output.After the printf,there are  two quotation mark between two braces.Between the quotation mark you can  write anything which you want to show on your console.

return 0;This statement tells the program to end his works.

This was our first program.Many programmer start their programming with this program Hello World.If you face any problem to understand then feel free to contact us.You can comment here or visit our Facebook page Coder Mania BD and Facebook group .
Thanks for being with coder mania bd.

Friday, February 19, 2016

The Basic structure of C.


If you want to be a good programmer,You need to know the basic structure of a language (C).

In C basically there are two parts.Like Include Files Part & Main function () part.


Include files like header files.There are many header files stored In C language library.such as #include <stdio.h>, #include <math.h>,#include <conio.h> etc.
Main function usually declare the variables and call the library functions,user defined functions.Every C program starts with main ().You can not think C without main ().In C,there can be many functions along with main ().Every function has specific work.
“Other functions” part is under main () function.Main () function call different types of library functions like, clrscr(),getch(),sqrt(),printf(),scanf(). And also call user defined functions.


Now I am going to describe a program sections.


You can write comments in the document section.To write single line comment use // and for multiline comment use /*……*/.
You have to link a header file in the link section.Header files define the library functions and keywords.Header files executes the program.
Symbolic constants are defined in the definition section.
Global variables are declared in the Global variable declaration section.Global variables can be used in several function.
Main function is a function where a program call the library functions and user defined functions.C program starts from compile and executes main() function.

Main function consist of two parts:

(1)Declaration part:- It declare all variables which are used in executable part.

(2)Executable part:- Executable part contains with  minimum one statement.


There is a Demo program for you:


#include <stdio.h>
int main ()
{
    printf("Hello World.");

 return 0;



Be continue.......

Wednesday, February 17, 2016

INTRODUCTION TO C


coder mania bd
C is a high level (2nd generation) structural language. With C you can solve scientific and mathematical problems. Beside this C has enormous uses like designing operating system, program developing, execute a database etc.

To start C what you will need?

At first you need a computer. A text editor.
I recommended you to use CODE BLOCK.It is a fantastic text editor.
I use it. 

you can download it from here:

For windows user :
go-->codeblocks.org-->downloads-->windows
For linux :
go-->codeblocks.org-->downloads-->linux
For Mac user :
go-->codeblocks.org-->downloads-->mac
If you face any problem to run this software in your computer then contact us through comment or join our group https://www.facebook.com/groups/codermaniabd/
Thanks for being with Coder Mania BD.
Namecheap.com

Popular Posts