Showing posts with label C. Show all posts
Showing posts with label C. Show all posts

Friday, 24 June 2016

program to add two number

hello guys today i m gonna show u a basic program to add to no....
so there are five airthematic operator in c/c++

  • + addition
  • - substraction
  • * multiplication
  • / division
  • % mod/remainder
here is an illustration to build a basic program to add to no :-

#include<stdio.h>
void main()
{
int a,b;
scanf("%d %d",&a,&b);   //inputing two no from the user
printf("\n addition = %d",a+b);
}

so this way we can add subs or perform any mathematical operation ....
we can also use 3 variable to perform same action by writing

c=a+b;
printf("addition=%d",&c);


Friday, 6 May 2016

Thursday, 17 March 2016

conio




Hello guys, today i am gonna tell you about the header file which is <conio.h>..
here is our basic program we are gonna study all of its element line by line so today is the turn of the 2nd line / 2nd header file which is conio.h , so here's our basic program...



#include<stdio.h>
#include<conio.h>
void main()
{
 clrscr();
 printf("hello world");
}


Wednesday, 16 March 2016

stdio.h?????

hello guys, today i am gonna tell you about most used header file which is <stdio.h>..

here is our basic program we are gonna study all of its element line by line so today is the turn of the 1st line / 1st header file which is stdio.h , so here's our basic program...


#include<stdio.h>
#include<conio.h>
void main()
{
 clrscr();
 printf("hello world");
}

so stdio plays an very important role actually it provide an interface . stdio.h stand for standard input output .

so what is standard input output?????

By hearing the word standard input or standard output we can understand it means keyboard (ie standard input) and monitor(ie standard output) . So header file stdio.h enables our program enables to use or interact with user using monitor and keyboard.we can understand  it better by taking an example of an ATM machine ( it is just hypothetical example ATM machine does not use C language ) , coming back to our example  ,ATM machine provide us an interface using keyboard ( keypad or touch keys ) and monitor (is screen) . So stdio enable our program to use standard input /output devices to communicate or interact with user.
In next post we will talk about conio.h we stay connect ..
you can follow me on twitter on @mayank8005.

     thank u.....


Tuesday, 15 March 2016

BASIC C program


hello guys , today we are gonna start with our 1st program in C language....we are gonna learn this program in small small parts cause this is your base for the future program so everything should be crystal clear.
soo here's our first program
#include <stdio.h>
#include <conio.h>
void main()
{ clrscr();
printf("hello world");
}

note: C and C++ is the case sensitive language



output:

hello world


to view output screen in turbo IDE we need to press alt+F5
turbo c contain 2 screen blue screen which is code window and other is black screen which is known as console window or output window
in programming language #  symbol is know as "poul".Actually unlike any other language in C  and C++ our program is first processed by an special software know as pre-processor after that compiler compiles our program.

source code -> pre-processor -> compiler



 so now the question is ....what is this pre-processor ???????

so by the word pre-processor we can understand that it is something that  starts / perform's its task before any process.IN our program there are some lines with .h extension for example #include<stdio.h> , these file are known as header files . BASICALLY  C IDE  provides us some preloaded functions or programs using which we can simplify our programs for example clrscr(); is an pre-defined function which comes under conio.h header file
pre-processor replace our header line with pre-defined functions that comes under that header file.we can see that if we compile our program then compiler will show around 400-500 lines compiled but our code is only of 7 lines therefore pre-processor replace lines which start with # with the functions which comes under that header file.so compiler does not deals with header line or the lines containing #include cause pre-processor replace these file with pre-defines functions.
thats all for today , we will discuss about each header files in my next post ....
follow me on twitter @mayank8005

thank u!!!!


Sunday, 13 March 2016

IDE.....!!!!

HELLO  guys , today i am gonna show you guys how to install IDE  of C langugae...
SO  guys what is an IDE ?
well guys ,IDE stands for integrated development environment . With a normal text editor you can only edit a text file , you can't compile it.you might be thinking what does the word compile mean, well guys we all know computer only understand machine language also known as binary language ie. (0 , 1).A compiler is an software which convert C language ( in this case ) to machine language. so IDE basically provides you the platform where you can write your program in C language and compile it soo that computer can understand it.
anyways, as a starter i advise you to use turbo c IDE , later on i will guide you to use other advance IDE such as code blocks etc

note : every IDE for C++ language also support C language SOMETIMES turbo C is mentioned as TURBO C++

here is the link to download turbo c  : https://turboc.codeplex.com/

for any problem in installation you can place a comment i will reply you as fast as possible.....
or can follow me on twitter @mayank8005

                               THANK U..........