read an array and search an element
Answer / meera
#include<stdio.h>
#include<conio.h>
void main()
{
int a[50],i,j,n,key,count=0;
clrscr();
printf("Enter the no.of elements:");
scanf("%d",&n);
printf("Enter the numbers:");
for(i=0;i<n;i++)
{
scanf("%d",&a[i]);
}
printf("enter the number to be searched:");
scanf("%d",&key);
for(i=0;i<n;i++)
{
if a[i]==key
(
count++;
printf("\nThe number %d is present",key);
}
}
printf("number of occurance is %d",count);
getch();
}
Is This Answer Correct ? | 1 Yes | 0 No |
When should you not use a type cast?
Explain which function in c can be used to append a string to another string?
why programming language C is still used in operating system's kernel??
How can you check to see whether a symbol is defined?
how to determine the complexity of an algorithm as log(n)
How many levels of indirection in pointers can you have in a single declaration?
0 Answers Agilent, ZS Associates,
what is the output for this question: main() { int i=1; printf("%d%d%d",i,i++,++i); }
What does s c mean on snapchat?
wat is the meaning of c?
int a=2,b=3,c=4; printf("a=%d,b=%d\n",a,b,c); what is the o/p?
Define Array of pointers.
write a 'c' program to sum the number of integer values