C program for count sorted characters, C/C++ Programming

 

# include stdio.h>

# include conio.h>

# include string.h>

void main()

 

{

          int i=0,j=0;

          char a[100],temp;

          clrscr();

          for(i=0;i<100;i++)

          {

                   a[i]=0;

          }

          i=0;

          printf("\nENTER THE STRING: ");

          gets(a);

          for(i=0;a[i]!='\0';i++)

          {

                   for(j=0;a[j]!='\0';j++)

                   {

                             if(a[i]

                             {

                                      temp=a[i];

                                      a[i]=a[j];

                                      a[j]=temp;

                             }

                   }

          }

          for(i=0;a[i]!='\0';i++)

          {

                   printf("%c",a[i]);

          }

          getch();

}

OUTPUT :

ENTER THE STRING: KAMLESH D MENGAR

 AADEEGHKLMMNRS

Posted Date: 9/10/2012 4:19:42 AM | Location : United States







Related Discussions:- C program for count sorted characters, Assignment Help, Ask Question on C program for count sorted characters, Get Answer, Expert's Help, C program for count sorted characters Discussions

Write discussion on C program for count sorted characters
Your posts are moderated
Related Questions
Explain the Loop Statements in Computer Programming? 1. C gives you a choice of three kinds of loop, while, do while and for. 2. The while loop remain repeating an action until

Problem : (a) What do you understand by the term ‘constructor' in Java? Explain with an appropriate example. (b) Describe the differences between an object and a class usi

The car’s measurements are illustrated, using two arrays. Array 1 = {L, R, L, R, R, L, R, R, L, R, R, L, R, L, L, R, Z}

overloadstream insertion opertator to display the data of object on the console

We started off taking about input, output, CPU and memory devices. Within C we need a method of storing large amounts of data in memory. We have used the idea of variables (pointer

Question: (a) A bank has four types of accounts with annual interest rates as follows: Savings 8% Savings with Cheque Book 5% Current 4% Fixed deposits 10% Using

A: Along with the C++ language, you can overload operators and functions. Overloading is the practice of supplying more than one definition for a provided function name in the same

Templates permit to create generic functions that admit any data type as parameters and return value without having to overload the function with all the possible data types. Until

Aim: To implement program to calculate area of cube using inline function. Code: inline void area_cube(float side) {             float area;             are

Define some features of register storage class in c program? The feature of variable defined to be of register type all as follows: Storage - CPU registers Default initia