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

Monday, September 9, 2013

COMPUTER TRAINING COURSE- C

Source:- Freshersworld
What is C programming ?
C programming is one of thousands of computer programming languages that allow users to create instructions for a computer to follow. While C has a slightly more cryptic style than some other programming languages, it's fairly easy to learn and allows you to read and write code for many different platforms. Because it's so efficient and gives the user a lot of control, C is very popular with programmers
Why Learn C?
There are an awful lot of programming languages available right now -- everything from the extremely high level (such as Visual Basic) to the low level power of assembly, and a good variety of specialized options in between (Perl, Ruby, and Python are good choices for many tasks). Java has also become quite the hot programming language for some tasks, in part because of its large API and in part because the virtual machine provides some elements of security. (Garbage collection is another nice feature and can make programmers much more efficient.) 
Nevertheless, there are some good reasons to learn to program in C. First, age has its advantages: C has been around for 30 years, and there is a ton of source code available. This means there's a lot to learn from, and a lot to use. Moreover, many of the issues with the language have been clearly elucidated -- it's well understood, and you can find a lot of tutorials available. Plus, with C, you get lots of strong opinions mixed with insights that you can understand
C is reasonably close to the machine. When you're working with pointers, bytes, and individual bits, things like optimization techniques start to make a lot more sense. There's also utility in knowing exactly how something works underneath the hood -- this helps a great deal when something you're trying to do in a higher level language seems way slower than expected, or just doesn't work at all. You also tend to get a better picture of advanced topics like exactly how networking works. A higher level language will make it a little bit simpler, but it'll be harder to understand what's going on, and when things stop working, it's much better to know exactly what's going on so you can fix it. Additionally, if you like computer science as a discipline, or just like knowing how things work learning the details of the system is great fun. 
In fact, a lot of fun programming is done in C -- for instance, system software and data managers such as Berkeley DB. If you want to be able to do more than write a simple web app, C is a great language. If you want to write a great, fast game, C is again a great choice. You can write an entire OS in C. It'll be much harder to do so in Java, and nearly impossible in a scripting language. And the language, being succinct as C is, will probably make your fun program more elegant looking to boot.

Tuesday, September 3, 2013

PPT ON FUNCTION IN C LANGUAGE


Download

Function In C Language Presentation Transcript: 
1.What is a FUNCTION?Function is a self contained block of statements that perform a coherent task of some kind.
Every C program can be a thought of the
collection of functions.

2.TYPES OF FUNCTIONS
Library functions.
These are the in-built functions of ‘C’ library.
These are already defined in header files.
e.g. printf( ); 
is a function which is used to print
output. It is defined in‘stdio.h’file .

3.User defined functions
Programmer can create their own function in C to perform specific task.
e.g.
#include
main( )
{
message( );
}

message( )
{
printf(“Hello”);
}

4.Some conclusion
Any C Program must contain at least one function.
If program contains only one function it must be
main( ).
There is no limit on the number of functions
present in a C program
Each function in a program is called in the
sequence specified by functions call in main( ).
After each function has done its thing, control
returns to main( ). When main( ) run out of
function calls program ends
C Program is a collection of one or more functions.
       A function gets called when its name is followed by a semicolon.

5. Advantages
It felicitate top down modular program.
The length of the source program can be reduce by using functions at
It is easy to locate and isolate and fault function easily
A function can used by many other program, it means programmer built an what have already done, insert of starting over scratch.

6. Using Functions
Using Functions The main functions and other library functions does need to be declared and defined but the main function’s body need to be defined by the programmer.

7. The 3 components associated with functions are
The Declaration
The function definition
The Calling Statement

8.In C user- written functions should normally be declared prior to its use to allow compiler to perform type checking on arguments used in its call statement. The general form is: Return_data_type  function_name (data_type Variable_name);

9.Function name
This is the name given to the function. It follows the same naming convention as that of any valid variable in C.
Return data type: this specifies the type of data given back to the calling construct.
Data type list: this list specifies the data type of each variables, the values of which are expected to be transmitted to the function. These variables are known as formal parameters.

10.The collection of program statements that does a specific tasks done by the function is called the function definition. It consist of
function header: Int FindMax(int x, int y) { }
function body. Int FindMax(int x, int y) { //body of the function…. }

11.The function is called from the main() The function can in turn call a another function. the function call statements invokes the function, which means the program control passes to that function. Once the function completes its task, the program control is passed back to the calling environment.
The general form of calling stmt is: Function_name (var1, var2,..); Or var_name=function name(var1, var2,..);


Source: Power Point Presentations