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
What is preprocessor with example?
What is the difference between far and near ?
`write a program to display the recomended action depends on a color of trafic light using nested if statments
Find duplicates in a file containing 6 digit number (like uid) in O (n) time.
What is the benefit of using #define to declare a constant?
Where are the auto variables stored?
What is a lookup table in c?
How can I swap two values without using a temporary?
Differentiate between new and malloc(), delete and free() ?
What are the functions to open and close file in c language?
What are the features of the c language?
What are the basic data types associated with c?
Explain what are the different file extensions involved when programming in c?
What are loops c?
Explain bit masking in c?