Headlines News :

Latest Post

Showing posts with label Basic C Tutorial. Show all posts
Showing posts with label Basic C Tutorial. Show all posts

Shorting of Array using insertion short

Written By Durgesh on Thursday, 1 March 2012 | 07:27

i am posting a shorting of array by using insertion short here logic behind insertion short id that  first element will compare with second and if first element is grater then second it will swap lets we know this by this image tutorial

let we see how we can implement in our program


#include<stdio.h>
void main()
{
 int A[20], N, Temp, i, j;
 clrscr();
 printf("\n\n\t ENTER THE NUMBER OF TERMS...: ");
 scanf("%d", &N);
 printf("\n\t ENTER THE ELEMENTS OF THE ARRAY...:");
 for(i=0; i<N; i++)
 {
  gotoxy(25,11+i);
  scanf("\n\t\t%d", &A[i]);
 }
 for(i=1; i<N; i++)
 {
  Temp = A[i];
  j = i-1;
  while(Temp<A[j] && j>=0)
  {
   A[j+1] = A[j];
   j = j-1;
  }
  A[j+1] = Temp;
 }
 printf("\n\tTHE ASCENDING ORDER LIST IS...:\n");
 for(i=0; i<N; i++)
  printf("\n\t\t\t%d", A[i]);
 getch();
}

What is C

Written By Durgesh on Sunday, 12 February 2012 | 07:19

What is c
We can say that c is programing language and we know that we need programing language to interact with computer
in detail  C is a structured, procedural programming language this language is used for operating sustems and application
reason behind using c language for operating system where we have adavanced version of c that is c++ and java and many for after that we use c that is why we know that in java there is  reference  is mean that if we write
int x=y; than value of y easily can be access 

but in c
int x=1;
ptr=&x;

so that access is not easily with C thaere is no scope of reference 

Many versions of UNIX-based operating systems are written in C. C has been standardized as part of the Portable Operating System Interface (POSIX).
 
Support : Creating Website | Johny Template | Mas Template
Copyright © 2011. Tutorial of Programing - All Rights Reserved
Template Modify by Creating Website
Proudly powered by Blogger