Thursday, 9 June 2016

How To Write A Simple 'C' Program ?

How To Write A Simple 'C' Program ?

programming is learnt by doing it not by reading concerning it.learning a artificial language is like learning the way to ride a cycle.You got to undertake it. you would possibly slip a couple of times and get hurt conjointly, how ever ultimately you'll learn it.The same is the true with with the programming. You have to write programs to learn programming. Do not worry and do not be afraid of programming. It is a wonderful world. The more you do , the more you enjoy -take my word. Now let us write our first C program. The following is a simple C program to display the given message on the screen.

I recommend Code Blocks as it is User Friendly Compared to Turbo C or Turbo C++.
Since it is a first program i am going to explain how to use Code Blocks.
If you don't have Code Blocks Download From{>>>HERE!<<<}

STEP 1 :Open the Code Blocks IDE !

STEP 2: Go-to File Menu Select Empty File.

STEP  3:  Save the file! I recommend Saving the file with a suitable name related to the program you are writing.So basically we are writing C programming so save the file With name.C where ' .C ' is the extension.


STEP 4: Write the program !! the program written below follows the basic syntax.
the syntax of the functions printf( ), main(), Will be explained  in further posts.
but For now printf("  ");
displays whatever written in the double Quotes.
STEP 5: After writing the program you have to compile or build(Ctrl + F9) the program, code blocks being an intelligent IDE give errors you can see them after you click the highlighted icon in the image below. if no errors proceed if you find errors correct them and then run(Ctrl + F10).


Explanation of The C program!

LINE  1: /*Program to Display a message on the screen*/
 It is a comment or remark. We give comments to make Program more readable.Comments in C start with /*(slash and asterisk) and with */(asterisk and slash) Combination. A comment can be given in multiple lines also.
LINE 2:  #include
This is a Processor Command. #include command is used to copy the contents of the given file into your program. In this example #include is used to include the contents of stdio.h header file. Though this is not mandatory it is better to include the header file ( .h files are called as header files )
using #include command. We will discuss more about #include in My Post About Header files  
LINE 3: main( )
Each C Program starts with a function called main. Program's Execution starts with main function and ends with main function . All the remaining functions
 ( standard and user defined functions) are called from main functions. When main function is terminated , the program is deemed to be terminated.
LINE 4-Line 8 : {........}
Each function contains a set of instructions enclosed in { }(braces). The statements given between braces will be executed when function is executed whenever you run a C program , all the statements given between { } of main function will be executed. A set of statements enclosed within { } are also called as a BLOCK. In other Words For each function you have a block and that block is executed whenever the function is called.
LINE 4 starts the BLOCK and LINE 8 Ends the Block.
LINE 6: printf( " " );
Function printf() is a standard function in C language. It is used to display the given values on to standard output device (Screen or Projector etc.).
Whatever value is given in double Quotes (" ") it is called as string literal. When a string literal is passed to pintf function , it will print it as it is. When you supply values to function , you have to supply values to function , you have to supply values by enclosing them in parenthesis So, the values that is to be displayed by printf is given within parenthesis. 
Every statement in C is to be terminated with ( ; ) That is why there is a semicolon at the end of the statement.
That is about the first program we have written in this blog.
Later in this We will learn how to enhance display using escape sequence characters.
OUTPUT:














Brief History of ' C '

Brief History of ' C 



C is a general-purpose programming language which features economy of expression, modern control flow and data structures, and a rich set of operators. C is not a "very high level" language, nor a "big" one, and is not specialized to any particular area of application. But its absence of restrictions and its generality make it more convenient and effective for many tasks than supposedly more powerful languages.
The history of C programming language is quite interesting. C was originally designed for and implemented on the UNIX operating system on the DEC PDP-ll, by Dennis Ritchie. C is the result of a development process that started with an older language called BCPL. BCPL was developed by Martin Richards, and it influenced a language called B, which was invented by Ken Thompson. B led to the development of C in the 1970s.

For many years, the de facto standard for C was the version supplied with the UNIX operating system. In the summer of 1983, a committee was established to create an ANSI (American National Standards Institute) standard that would define the C language. The standardization process took six years (much longer than anyone reasonably expected).
The ANSI C standard was finally adopted in December 1989, with the first copies becoming available in early 1990. The standard was also adopted by ISO (International Standards Organization), and the resulting standard was typically referred to as ANSI/ISO Standard C. In 1995, Amendment 1 to the C standard was adopted, which, among other things, added several new library functions. The 1989 standard for C, along with Amendment 1, became a base document for Standard C++, defining the C subset of C++. The version of C defined by the 1989 standard is commonly referred to as C89.
During the 1990s, a new standard for C was being developed. It was the 1999 standard for C, usually referred to as C99. In general, C99 retained nearly all of the features of C89. The C99 standardization committee focused on two main areas: the addition of several numeric libraries and the development of some special-use, but highly innovative, new features, such as variable-length arrays and the restrict pointer qualifier. These innovations have once again put C at the forefront of computer language development.
C89 is the version of C in widest use, it is currently accepted by all C compilers, and it forms the basis for C++.
Hope you have enjoyed reading C programming language's history of evolution. Please do send suggestion if you have any or comment if you come across any error on this page. Thanks for reading!

Wednesday, 8 June 2016

Lets start with 'C'

Let's Start With 'C'

In my opinion, 'C' is the first language one should understand.It teaches programming and prepares you for complex languages such as C++, JAVA and C#.It is very important to learn this language to lay a solid foundation in programming.
Programming is fun. How ever , not everyone Who wants to be a programer would realise it, because some lack efforts and some lack direction. This is for people who don't know till what extent to work on basic ' C ',I am posting these keeping beginers in mind. The order of the further posts will be the order in which you will better understand these topics.


What is 'C' language ?

C , is a general-purpose programming language. A programming language is used to write programs . A program is a collection of instructions that accomplishes a particular task. For example , a program may find out the highest number out of 10 numbers ,another program may display the contents of a file on the screen and so on .The task that a program accomplishes may just be anything - from very complicated to trival . C is one of the most widely used programming languages.

C is called as middle - level languages because it contains the features of high - level languages such as Pascal and low - level languages - Assembly languages . C allows the programmer to access system resources directly , any feature only available in Assembly language. For example ,a program written in Assembly language can directly access a location in memory , a sector of the directly access a location in memory , a sector  of the diskette , and send data through the serial port of the machines, etc. C also has feature that are commonly found only in high-level languages like Coblo, Pascal , etc. For example ,a program written in 'C'
is portable it means ,it can run on any machine and any operating system , as long as a compiler of C is available on the target machine. 





                                                                      










Monday, 6 June 2016

Why To Code





Five years ago, the answer to "why learn to program" may have been simple: to get a nice, cushy job with beanbag chairs and a six-figure salary. Recently, the job market for programmers has lost some of its previous luster--no longer can anyone and his dog start a tech company, get venture capital, and pay programmers a combination of stock options and worth millions and a high salary. 


This seems to have taken its toll on the number of prospective programmers; at some colleges, intro computer science classes are at all-time lows in attendance. This is a real shame because programming isn't really about making the big bucks. Though you will certainly be well paid if you are very good, your doctor friends are unlikely to be jealous of your finances once they pay off their medical school loans. 

They will, however, be envious of the intangibles.


Be The Creator

When you program, you are a creator. You go from a blank text file to a working program with nothing to limit you but your imagination (and maybe some issues like how long your program takes to run). Programming is like having access to the absolute best set of legos in the world in almost unlimited qualities. Even better, you can get all of your building materials completely for free (once you own a computer) on the internet. Amazing! 

It's also great fun to see someone using something that you made. Your ability to improve your life and the lives of your friends and family is limited only by your ideas once you can take full control of your computer. Moreover, your work can be extremely high quality because the limiting factor is not manual dexterity or other non-mental attributes. If you can understand a programming technique, you can implement and use it.

Automation

Programmers are famous for being lazy--in fact, being lazy is one reason people are drawn to programming. After all, why do something routine and repetitive when you could have your computer do it for you? Programmers have written all sorts of simple-to-use tools that make life easier for them--especially tools to manage the complexity of creating software (for instance, tools to help keep track of all the ways of making a program, or debugers to help improve their understanding of a running program). 

But more than that, every programmer has a collection of simple tools that he or she uses on a day-to-day basis, from custom calendar reminder programs to processors for large data sets (especially useful for scientists!). Indeed, the physics community has a history of writing powerful tools that make their lives easier--one tool, HTML over HTTP, created by Tim Berners Lee, eventually became the world wide web. It was originally designed by a physicist programmer coming up with ways of simplifying his life.

Respect And Can Rejoice 'Why ?' 

People are often frustrated by technology when it fails. Although operating systems such as Windows have become much more stable, there are still many security holes exploited every day. For a non-programmer, these issues are mysteries: the machine that never makes mistakes is full of problems, and who knows why? 

Programmers, on the other hand, are familiar with the limits of the machine--what happens inside the computer when it takes several minutes to open large files, why a particular security hole is a problem, and why it's so difficult to get large-scale software projects right. 

They understand it because they've dealt with most of these issues in their own programs and work with the ``stuff'' of the machine (to varying degrees across different programming languages). This can lead to some exciting finds, such as realizing how you can earn thousands of dollars in Windows solitaire set to Las Vegas style. Maybe not as good as earning real money, but how many of your friends have made $32K on under an hour playing cards? 

In sum, programming lets you work with your mind to free yourself to create things that are interesting or useful instead of being limited by the confines of what others have done before, and even when using those other things, you'll find that you can better appreciate and understand them.
Subscribe Here !