write a program to search for an element in a given array.
If the array was found then display its position otherwise
display appropriate message in c language
Answer Posted / laxmi
#include<stdio.h>
#include<conio.h>
void main()
{
int a[5]={1,2,3,4,5};
int i;
clrscr();
printf("
enter the value");
scanf("%d",&i);
for(i=0;i<5;i++)
if(i<5)
{
printf("
the value is present=%d");
}
else
{
printf("
the value is absent=%d");
}
getch();
}
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
Explain the advantages of using macro in c language?
Explain is it valid to address one element beyond the end of an array?
main() { inta=10,b=20; a>=5?b=100:b=200; printf("%d ",b); }
What is ctrl c called?
What are the types of macro formats?
What is time complexity c?
What are the types of type specifiers?
How variables are declared in c?
What is c definition?
Difference between constant pointer and pointer to a constant.
What is volatile, register definition in C
Explain the concept and use of type void.
What is the difference between array and pointer?
What are predefined functions in c?
List some applications of c programming language?