Facebook
From CL4, 8 Months ago, written in Plain Text.
This paste is a reply to CSE 2.1 CL2 from MSE - view diff
Embed
Download Paste or View Raw
Hits: 392
  1. #include<stdio.h>
  2.  
  3. int main() {
  4.  
  5.     char line[100];
  6.     int i, j, num, count=0;
  7.     char vowels[11] = "aeiouAEIOU";
  8.     printf("Enter a string: ");
  9.     gets(line);
  10.  
  11.     for (i = 0; line[i] != '\0'; i++);
  12.     num = i;
  13.  
  14.  
  15.     for(i = num-1; i >= 0; i--) {
  16.         printf("%c", line[i]);
  17.     }
  18.  
  19.     printf("\nThe vowels are:");
  20.     for(i=0; line[i]!='\0'; i++)
  21.             {
  22.                 for(j=0; vowels[j]!='\0'; j++)
  23.                     {
  24.                         if(line[i]==vowels[j])
  25.                             {
  26.                                 count++;
  27.                                 printf("%c",line[i]);
  28.                             }
  29.                     }
  30.               }
  31.     printf("\nNumber of vowels = %d", count);
  32.  
  33.  
  34.  
  35.     return 0;
  36. }
  37.  

Replies to Re: CSE 2.1 CL2 rss

Title Name Language When
Re: Re: CSE 2.1 CL2 CL5 text 7 Months ago.
CL5 DW text 7 Months ago.