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 |
how to find the sizof of any datatype using bit manipulations
What is register variable in c language?
Write a programe print the sum of series 0,1,2,.....10
The statement, int(*x[]) () what does in indicate?
Write a c code segment using a for loop that calculates and prints the sum of the even integers from 2 to 30, inclusive?
Explain in detail how strset (string handling function works )pls explain it with an example.
What are linker error?
What is the difference between call by value and call by reference in c?
main() { int i; for(i=0;i<5;i++) printf("%d",1l<<i); } why doesn't 'l' affect the code??????
program to find out date after adding 31 days to a date in the month of febraury also consider the leap year
Can you tell me how to check whether a linked list is circular?
void main() { int i=5; printf("%d",i++ + ++i); }