Introduction To Programming

Why programs ? Programming is nothing but making the computers think the same way a human thinks. Programs are made for obtaining a specific solution which can even be solved by humans which when solved by us may consume time..

Saturday, April 24, 2010

Additon without Arithmetic Operators:

Here is the program which use bit wise operator and perform the addition operation. There is no arithmetic operator is used in this program.

int main()
int a,b,sum,carry;
printf("Enter the values");
scanf("%d %d",&a,&b);

Program without Header File

is it possible to run the program without header file?  yes, it is possible.  consider the following program.

int main()
return 0;
 It will work perfectly ,if you save the file.  But the concept is that while compiling itself ,compiler includes stdio.h header file automatically. 

Predict the Output:

int main()
return 0;

Error,stdout is undeclared
Hello will be printed in console
Hello will be print in stdout.c file

Will it work?

int main()
return 0;


exit Function:

This article will teach you what the exit function does.

Definition of exit Function:
exit function terminates the program process. It is called as "exit(error_status)"
 consider this following program:

Difference between Normal function and Macro Funcion

Normal function is defined :
return_type function_name(arguments)
Macro function:
#define funtion_name(arguments) coding

while compiler expanding the code, the macro function is replaced in called place, but normal function is just called by . 

Macro function example source code and expanded code:

Source Code:
#define tech() printf("hi")
int main()

Run the coding after exiting main function

Do you think that it is possible to run the code after exiting main function? Yes ,it is possible to run the codes after exiting main function also.

Consider this Simple Program:
void after_main()

Pointer vs Array

Let you teach what is difference between pointer and array. Firs of all we should know the definition of pointer and array.

Pointer is a variable that capable of storing the address
Array is collection of same elements

Difference between #include and #include "stdio.h"

Many of you confused with this two method of specifying the include files. This article will teach you what the difference between these two is.

#include <stdio.h>

This method of specifying is used to include the standard header files.