C (programming language)

From Wikipedia, the free encyclopedia
Jump to navigation Jump to search

The C programming language is a computer programming language that was developed to do system programming for the operating system UNIX and is an imperative programming language. C was developed in the early 1970s by Ken Thompson and Dennis Ritchie at Bell Labs. It is a procedural language, which means that people can write their programs as a series of step-by-step instructions. C is a compiled language.

Because the ideas behind C are kept close to the design of the computer, the compiler (program builder) can generate machine code/native code for the computer. Programs built in machine code are very fast. This makes C a good language for writing operating systems. Many operating systems, including Linux and UNIX, are programmed using this language. The language itself has very few keywords, and most things are done using libraries, which are collections of code for them to be reused.

C is available for many different types of computers. This is why C is called a "portable" language. A program that is written in C and that respects certain limitations can be compiled for many different platforms.

The syntax of C has also influenced many other programming languages, such as C++, C#, and Java, and many more programming languages we use nowadays.

  1. include<stdio.h>

int check(int a[],int n); int main() {

int n,a[10],i;
printf("Enter no of elements n :");
scanf("%d",&n);
printf("\nEnter array elements");
for(i=0;i<n;i++)
{
 scanf("%d",&a[i]);
}
if(check(a,n-1))
{
 printf("\nArray is sorted");
}
else
{
 printf("Array is not sorted");
}

return 0; } int check(int a[],int n) {

if(n==0)
{
 return 1;
}
else
{
 if(a[n]>a[n-1])
 {
  return check(a,n-1);
 }
 else
 {
  return 0;
 }
}

}

Related pages[change | change source]

Other websites[change | change source]