answersLogoWhite

0

#include<stdio.h>

#include<conio.h>

void main( )

{

int a[50],i,n,s,t=0;/* the digit 50 can be any integer, its a user defined function a[limit]*/

clrscr( );

printf("\n\nenter the number of elements u want to enter");

scanf("%d",&n);

printf("\n\nenter the numbers u desire");

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

scanf("%d",&a[i]);

printf("enter the element to be counted");

scanf("%d",&s);

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

{

if(s==a[i])

t++;

}

printf("the number u entered has occured %d number of times",t);

getch( );

}

User Avatar

Wiki User

15y ago

What else can I help you with?