Tagged: C Programming

why learn C programming 3

Why learn C programming and C++ programming & How to

C Programming is considered as one of the best and easy to learn programming language. C programming was introduced many decades ago and still it is one of the most popular languages in the programming world. When I started with programming, I had a question in mind – How to learn programming? There were many programming languages available for me to start with, like C, C++, Java, C# and so on. To be frank, I had started with Java programming. Initial few says were awesome. Started with an introduction to Java, then started with java basics which included statements, loops,...

Introduction to C programming 97

Introduction to C Programming Language

C programming is a language developed by AT & T’s Bell Laboratories of USA in 1972. It was designed and written by a man named Dennis Ritchie. C language is reliable, simple and easy to use. It has survived for more than 3 decades. This language is a base to learn different programming language. If you want to learn C++ or JAVA, without the knowledge of C, it becomes very difficult to learn these programming languages. Many major components of popular operating systems like Windows, UNIX, LINUX is still written in C. Nothing beats C language in terms of speed of...

Sort character array in ascending order in C 7

C program to sort character array (string) in ascending order

Below is the simple C program that will accept the character string from the user, calculates the length of the string and performs sorting operation on the string. The program will sort the character array in ascending order and display the result string (character array). Here we go, #include<stdio.h> #include<conio.h> void main() { clrscr(); int i,j; char *arr; //accept character array string from user printf(“Enter character string: “); gets(arr); //get the length of array in the variable counter int counter = 0; while(arr[counter] != NULL){ counter = counter + 1; } //apply ascending sorting algorithm for(i=0; i<counter; i++) { for(j=i;...