Pages - Menu

Tuesday, 22 July 2014

Implementation of bit stuffing in C.

Here is the code..

Implementation of bit stuffing and destuffing in C.

Here is the code..

Program to implement Even Parity in C.

Here is the Code..

Program to calculate hamming Distance in C.

Here is the code..

Implementation of bit destuffing in C.

Here is the code..

Implementation of Queue using Linked list in C.

Here is the code..

Implementation of Queue in C.

Here is the code..

Implementation of Regula Falsi Method in C.

Here is the code..

Implementation of Trapizodial rule in C.

Here is the code..

Implementation of simpson three eight rule in C.

Here is the code..

Implementation of Simpson one third rule in C.

Here is the code..

Implementation of Newton Rapson method in C.

Here is the code..

Implementation of Newton Forward Interpolation Formula in C.

Here is the code..

Implementation of n divided difference formula in C.

Here is the code..

Implementation of Lagrange Interpolation Formula in C.

Here is the code..

Implementation of linked list in C.

Here is the code..

Implementation of Stack using linked list in C.

Here is the code..

Monday, 21 July 2014

Implementation of merge sort in C.

Here is the code..


Implementation of Quick Sort in C.

Here is the code..

Program to implement insertion sort in C.

Here is the code..

Implementation of Stack in C.

Here is the code.. 

Program for deletion of particular element of array in C.

Here is the code..

Implementation of backward interpolation method in C.

Here is the code..

Program for insertion at particular position in given array in C.

Here is the code.. 

Program to calculate transpose of matrix in C.

Here is the code..

Program to implement binary search in C.

Here is the code..

Multiplication of two matrices in C.

Here is the code..

Program for Linear Search in C.

Here is the code..

Program to delete all duplicate elements in an array in C.

Here is the code..

Program to print diagonal of matrix in C.

Here is the code..

Program to calculate sum of two matrices in C.

Code is here..

Saturday, 19 July 2014

Shutdown system using C.

You can shutdown your system using a c program.
Here is the code to shut down the system in c.

For window xp:

(After 30 seconds)

 If you are using turbo c then you can not do that from the compiler directly you should execute the file from folder.
#include <stdio.h>
#include <stdlib.h>

int main()
{
   char c;

   printf("Do you want to shutdown your system: (y/n)\n");
   scanf("%c",&c);

   if (ch == 'y' || ch == 'Y')
      system("C:\\WINDOWS\\System32\\shutdown -s");
   return 0;
}

Program without main in C.

Here is a simple C PROGRAM without using a main() function.



#include<stdio.h>
#define Compose(f,a,b,c,d,e) c##d##a##b
#define start Compose(f,i,n,m,a,f)
int start()
{
    printf("Hello.");
    return 1;
}

Concept:


## Concatenates two characters when we define start as decode(f,i,n,m,a,f) then it is decoded as main.
So there is a hidden main here.

Another program is



Printing Map of India in C.

Concept:

The long string is simply a binary sequence converted to ASCII. The first for statement makes start out at 10, and the [b+++21] after the string yields 31. Treating the string as an array, offset 31 is the start of the "real" data in the string (the second line in the code sample you provided). The rest of the code simply loops through the bit sequence, converting the 1's and 0's to !'s and whitespace and printing one character at a time.


HERE is the code for the map:

#include <stdio.h>
int main()
{
    int a,b,c;
    int count = 1;
    for (b=c=10;a="- FIGURE?, UMKC,XYZHello Folks,\
    TFy!QJu ROo TNn(ROo)SLq SLq ULo+\
    UHs UJq TNn*RPn/QPbEWS_JSWQAIJO^\
    NBELPeHBFHT}TnALVlBLOFAkHFOuFETp\
    HCStHAUFAgcEAelclcn^r^r\\tZvYxXy\
    T|S~Pn SPm SOn TNn ULo0ULo#ULo-W\
    Hq!WFs XDt!" [b+++21]; )
    for(; a-- > 64 ; )
    putchar ( ++c=='Z' ? c = c/ 9:33^b&1);
    return 1;
}

Quine in c

A program that prints itself is called Quine program

Concept:


Open the same file in read mode and start reading and printing from the file character by character till END OF FILE is reached Here is the code:

#include<stdio.h>
int main()
{
FILE *fp;
char ch;
fp=fopen("selfprint.c","r");
/* Enter your program name here*/
while((ch=fgetc(fp))!=EOF)    
printf("%c",ch);
fclose(fp);    
return(1);
}

Another code is here

Addition of two numbers in C.

Here is the code


Writing First Program in C.


Type the program as:

#include <stdio.h>       
/* inserts the code to use the fuctions like printf bydefault*/
int main ( int argc, char *argv[] )  
/* Program execution starts from here argc is used to get number of command line arguements(input from command prompt) and argv[] stores the command line arguements*/
{
   printf("WELCOME TO THE WORLD OF C PROGRAMMING");
/* print the written string */
   return 1;
/* return from the execution*/
/* Lines between me are comments you can skip these lines these are just to explain the things */

Why C?

This a common question among programmers. It is a dynamic IT world where languages come and get obsolete very early. So there is something in c which is most popular programming language for last three decades. The reasons for this wide acceptability is:

1.SIMPLE AND EASY

 In terms of learning it is the most easiest and simple language than any other till now.

2.PERFORMANCE:

 There is no match of c in terms of execution speed and performance.

3.OPERATING SYSTEM:

 Operating systems are still written in c. Major part of UNIX , WINDOWS , MAC and other operating systems are written in c.

4.DEVICE DRIVERS:

 Device drivers of new devices are always written in c language. The main reason of this is that C enables direct access to basic elements of the system and also memory.

5.EMBEDDED SYSTEMS:

Embedded systems is also a major part of anybody's life. Everybody uses mobiles, palmtops ,PDA's , refridgerators ,washing machines , microwaves, televisions etc. The coding of all these devices is still written in c.

For example, C programs can be compiled and run on the HP 50g calculator (ARM processor), the TI-89 calculator (68000 processor), Palm OS Cobalt smartphones (ARM processor), the original iMac(PowerPC), the Arduino (Atmel AVR), and the Intel iMac (Intel Core 2 Duo).