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
flow chart for push operation in stack

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

Insert values in queue - C++ program: Write a program to insert values in queue. int main()   {         int k;     Queue timeLine;     cout     for(

A: auto: the default. Variables are created and initialized automatically while they are defined and destroyed at the ending of the block containing their definition. They are not

convert BST into sorted doubly linked list

A: No. (Excluding if you have an old compiler, you might have to force the new operator to throw an exception if it runs out of memory.) This turns out to be a real pain to alwa

It is standard on functions to provide some indication that the function has succeeded in its operation. Consider the Scanf function:     scanf("%d",&number1);   If the functio

What is a newline escape sequence? - A newline escape sequence is signified by the \n character. - It is used to insert a new line whereas displaying the output data. - T

main() { int a[5]={1,3,6,7,0}; int *b; b=&a[2]; } The value of b[-1] is