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 |
#include<stdio.h> #include<conio.h> struct stu { int i; char j; }; union uni { int i; char j; }; void main() { int j,k; clrscr(); struct stu s; j=sizeof(s); printf("%d",j); union uni u; k=sizeof(u); printf("%d",k); getch(); } what is value of j and k.
What is sparse file?
can v write main() { main(); } Is it true?
What is the difference between int main and void main?
How do we select the big element or any other operation from array which is read dynamically. user need to give the elements only no need to mention the size.
Why can’t we compare structures?
What are pointers in C?
Is null valid for pointers to functions?
What does return 1 means in c?
Explain what is wrong with this program statement? Void = 10;
How are pointers declared in c?
Write a C program in Fibonacci series.