Friday 25 April 2014
On 23:11 by Vardan Kumar in C tutorial No comments
Let us begin with a brief introduction of C. C is a middle level language that was originally developed by Dennis Ritchie for the Unix operating system. It was first implemented on the Digital Equipment Corporation PDP-11 computer in 1972. It is a middle level language because via C one can develop both system software and application software.
All the application of Unix operating system are virtually written on C language.
All the application of Unix operating system are virtually written on C language.
Main features of C language.
- C follows the Modular programming approach i.e it provides a software design technique to which software is composed of separate parts.
- C programs are Portable i.e they can run on any compiler with a little of no modification.
- C provide wide variety of Data types.
- C provides Bit manipulation i.e we can manage various operation on bit level or we can manage memory on bit level.
- C supports efficient use of pointers.
The only way to learn a new programming language is by writing programs in it.
Let us start with a program...
Print the words
Cspassion - never under estimate the power of passion
It is a hurdle so to leap over it you have to write program text, compile it and run it.
In C the program to print the above text is.
#include <stdio.h>
main()
{
printf("Cspassion-never under estimate the power of passion");
}
This running process vary from system to system i.e if you are using UNIX operating system you must create a program in a file whose name ends with extension ".c" ex. cspassion.c, then compile it with command
cc cspassion.c
if you haven't botched anything, such as omitting a character or misspelling something, the compilation will complete silently and it makes a executable file named, cspassion.out
if you run a.out by typing the command
cspassion.out
it will print
Cspassion-never underestimate the power of passion!
The output screen will be like this
A C program always consists of functions and variables. A function contains statements that specifies the computing operation to be done and variables stores values stored during computation.
Explanation of above program
- #include<stdio.h>:- This line tells the compiler to include the information about standard input/output libraries. This line always appear at the beginning of C source file.
- main():-This defines a function named main that receives no argument values. program always begins executing at the beginning of main. Main usually call other functions to help perform its job, some that you wrote.
- { }:- These are braces. statements of main function are enclosed in braces.
- printf("cspassion- never under estimate the power of passion!"); :-As the function is always called by naming it, followed by parenthesized list of arguments. here printf is a function with s a list of arguments in the form of character strings.
Note:-
- printf never supplies a new line automatically.
- \n is used in C notation for newline character.
- among other C also provides \t for tab, \b for backspace, \" for double quote, \\ for backslash itself.
Viva Questions???
- Who developed the C language And in which year? (Dennis Ritchie in 1972 ).
- Why C is a middle level language? (because via C one can make both system software and application software?
Let me ask you some questions?
- As main function calls other function and we also know that main is also a function then tell me main is called by_____?
- printf("cspassion
");
Will the compiler accept this format?
By:Hardik Thakral
By:Hardik Thakral
Subscribe to:
Post Comments (Atom)
Search
Popular Posts
-
Troubleshooting Cisco VPN client Before starting troubleshooting, Let us see what VPN is and what it requires to perform its intended f...
-
Evolution-Mobile Phones With the development of portable technology,wireless communication has so evolved that (According to the announce...
-
File Versioning C# File versioning, saving file with unique file name in c# File versioning allows a user to have several versions of ...
-
Text Box Hint in c# Windows Form Application Text Box Hint in c# Windows Form Application While developing a windows form applicat...
-
Unable to set the Freeze Panes property of Window Class C# It is generally easy to resolve the compile time errors because the reason fo...
0 comments:
Post a Comment