Answers

2014-03-10T20:48:53+05:30
#include <stdio.h>
#include <string.h>

void main ()
{
   char str[50], str1[50];
   int len, count = 0, j = 0;

   strcpy(str, "This is tutorialspoint.com");

   len = strlen(str);
   for(int i = 0; i < len; i++; )
   {
     switch( str[i])
     {
        case 'a' : count++;
                   break;
        case 'e' : count++;
                   break;
        case 'i' : count++;
                   break;
        case 'o' : count++;
                   break;
        case 'u' : count++;
                   break;
        default  : break;
     }   
    }
    for(int i= len-1; i<=0; i--)
    {
       str1[j] = str[i];
       j++;
    }
   
   printf("Length of |%s| is |%d|\n", str, len);
   printf("Count of |%s| is |%d|\n", str, count);
   printf("Reverse of |%s| is |%s|\n", str, str1);
  
}

0
2014-03-11T19:43:31+05:30
#include <stdio.h>
#include <string.h>

void main ()
{
   char str[50], str1[50];
   int len, count = 0, j = 0;

   strcpy(str, "This is tutorialspoint.com");

   len = strlen(str);
   for(int i = 0; i < len; i++; )
   {
     switch( str[i])
     {
        case 'a' : count++;
                   break;
        case 'e' : count++;
                   break;
        case 'i' : count++;
                   break;
        case 'o' : count++;
                   break;
        case 'u' : count++;
                   break; 
        default  : break;
     }    
    }
    for(int i= len-1; i<=0; i--)
    {
       str1[j] = str[i];
       j++;
    }
    
   printf("Length of |%s| is |%d|\n", str, len);
   printf("Count of |%s| is |%d|\n", str, count);
   printf("Reverse of |%s| is |%s|\n", str, str1);
   
}
0