C Programming Tutorials

C Programming Tutorials And Articles
  Title Reverse Sort Order / Author Replies
Views
Array is a data structure consists of a group of elements of same data type. We can think it as collection of variable of similar data type. Array prototype: Data_type array_name Example: Suppose you have a team of 10 employees. Id is given for every employee. You want to store id, age...
0
1,680
Function is a block of statements that performs a specific task. It is reusable portion of the code and a very effective way to modularize your program. For example, you may need to perform different arithmetic operations in your program like addition, subtraction, multiplication and division....
1
1,784
When an ELF executable is executed, a process is created and its process image is create in the RAM. However, it is here in the process image in RAM, all the variables are assigned memory. Sometimes memory is allocated statically i.e. defined how much memory at the compile time, and at times it has...
3
3,345
Generally a question is asked that if you have given n bits then print out all the possible binary numbers of n bit and so I will try to explain how to get that done. Please don't Copy Paste. Understand The logic because it is useful in other problems as well for eg if n=1 then you can have 0...
2
8,044
List of helpful C tools that will help you peek inside a process or an a.out file. Some are specific to Sun OS. I have compiled it into an easy-to-read summary of what each one does, and where to find them. Going through the man pages for each, and try running each on a couple of different a.outís...
5
3,586
Type casting is an explicit type conversion requested by the programmer to achieve its objective in the program. During any kind of computations involving various data variables of different data types, leads to the need of typecasting. Syntax used: (Data-type-2)<variable/expression of data...
0
1,928
I have been writing many articles on C/Linux explaining concepts, APIs and their usage etc. This time I thought to write on a fundamental concept that every newbie should be well aware of in order to become a good coder, ie 'Good coding practices'. I have 3-4 broader level points to make here. I'll...
0
3,094
Calculating the factorial of a number is a basic excercise while learning to program in C, many of us have done it iteratively, it can also be done recursively. I am posting both iterative and recursive versions below. /* Recursive Version */ unsigned int recursive_factorial(int n) ...
30
34,581
The below program calculates the largest no among the no entered but it just calculates as user inputs them. This can be used with files and as you move ahead in file you can store the max and the min value in a variable when parsing the file. #include<stdio.h> int largest(int,int); void...
5
2,809
The below code is a calculator in plain C. It does not take into account the operability of bodmas but just one operation at a time. The main thing in the source code below in the scanf which scans the input as number symbol number just as in case of normal calculator. #include<stdio.h> ...
34
129,043
Here is the code which displays the Calendar of the month entered by the user. #include<stdio.h> #include<conio.h> #define Y 1900 /*1/1/1900 monday*/ void days(int *,int *); void display(int *, int);
5
3,384
C program to check whether a year is a leap year or not. /* ** C program to check whether an entered year is a leap year or not ** @author: Pradeep ** @date: 02/12/06 */ #include<stdio.h>
12
131,911
Introduction The idea is simple just to test whether the expression contains correct sequence of brackets or not. void main() { char arr; char *top; int loop=0,i,l,binary;
2
1,803
Program for singly circular linked list which inserts, deletes, searches .... data in it #include <stdio.h> #include <conio.h> #include <stdlib.h> #include <string.h> /***** Structure template *****/ struct list{
37
92,704
Comma-separated expressions were inherited from C. It's likely that you use such expressions in for- and while-loops rather often. Yet, the language rules in this regard are far from being intuitive. First, let's see what a comma separated expression is. An expression may consist of one or...
3
7,267
Introduction A command line argument is a parameter which is passed to a program at the time or instant when it is invoked or executed from the command line .This is accomplished by passing information to main() method of the program. It is the information that directly follows the program’s...
3
12,871
Commonly used C Preprocessor Directives #define You can use the #define directive to give a meaningful name to a constant in your program. The two forms of the syntax are: Syntax : #define identifier token-string #define identifier token-string
1
7,342
The keyword ‘static’ has been widely used in many programming languages. I know it is there in Java, C and C++. I am pretty sure, it is must be used in other languages as well, even though it might depict different attributes and characteristics. However, we are going to learn about the keyword...
1
3,667
Conditional statements are statements, which are executed depending on some condition being satisfied as true or false. In this tutorial, we will try to learn some conditional statements which include: If-else, switch, break and continue which controls the behaviour of loop to some extent. if...
0
1,776
Introduction In C you can effectively change the value of the constant variable. Just compile the following program and you will see the output. void main() { int const i=123; int *ip;
11
6,943