This is default featured slide 1 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

This is default featured slide 2 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

This is default featured slide 3 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

This is default featured slide 4 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

This is default featured slide 5 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

C Program to calculate frequency of vowels in a string

/********************************************************************** 
C Program to calculate frequency of vowels in a string

 **********************************************************************/
#include <stdio.h>
#include <conio.h>
void main()
{
  int a=0,e=0,i=0,o=0,u=0,sum=0;
  char c;
  printf("Enter string:-  ");
  printf("\nString will be terminated if you press Ctrl-Z & then ENTER.");
  printf("\nSTRING:-  ");
  while ((c=getchar())!=EOF)
    {
      if (c=='a'||c=='A')
        a=a+1;
      if (c=='e'||c=='E')
        e=e+1;
      if (c=='i'||c=='I')
        i=i+1;
      if (c=='o'||c=='O')
        o=o+1;
      if (c=='u'||c=='U')
        u=u+1;
    }
  sum=a+e+i+o+u;
  printf("\nFrequency of vowel 'a' is %d.",a);
  printf("\nFrequency of vowel 'e' is %d.",e);
  printf("\nFrequency of vowel 'i' is %d.",i);
  printf("\nFrequency of vowel 'o' is %d.",o);
  printf("\nFrequency of vowel 'u' is %d.",u);
  printf("\nTotal no. of vowels in the text is %d.",sum);
}

/*

OUTPUT:
Enter string:-
String will be terminated if you press Ctrl-Z & then ENTER.
STRING:-  weghwehfgwwwpqezrhdnxmy,aldhfbvgctesvdchxmakwqpriuzttrewqasdgfhjklmynxc

Frequency of vowel 'a' is 3.
Frequency of vowel 'e' is 5.
Frequency of vowel 'i' is 1.


*/

Binary to integer


C Program to Print Binary Equivalent of an Integer using Recursion


This C program, using recursion, finds the binary equivalent of a decimal number entered by the user. Decimal numbers are of base 10 while binary numbers are of base 2.
Here is the source code of the C program to display a linked list in reverse. The C program is successfully compiled and run on a Linux system. The program output is also shown below.
  1. /*
  2.  * C Program to Print Binary Equivalent of an Integer using Recursion
  3.  */
  4. #include <stdio.h>
  5. int binary_conversion(int);
  6. int main()
  7. {
  8.    int num, bin;
  9.    printf("Enter a decimal number: ");
  10.    scanf("%d", &num);
  11.    bin = binary_conversion(num);
  12.    printf("The binary equivalent of %d is %d\n", num, bin);
  13. }
  14. int binary_conversion(int num)
  15. {
  16.     if (num == 0)
  17.     {
  18.         return 0;
  19.     }
  20.     else
  21.     {
  22.         return (num % 2) + 10 * binary_conversion(num / 2);
  23.     }
  24. }
  25. }
advertisements
$ gcc binary_recr.c -o binary_recr
$ a.out
Enter a decimal number: 10
The binary equivalent of 10 is 1010

akdfk

Prerequisites

We strongly recommend you have a firm understanding of HTML before you start learning CSS. This will only maximize your proficiency in the language and make your more effective as a designer.

Example of CSS code

Recommended Software

SoftwarePositivesNegatives
NotepadFree software. Very easy to use. Great for programmers who are just getting started. This is a program you can always fall back on without having to install any program.Doesn’t format code or 

akjfhalf


Program


Hi