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 how do you determine whether to use a stream function or a low-level function?
What is the size of empty structure in c?
Explain how can you tell whether two strings are the same?
Why do we use return in c?
Explain how do you sort filenames in a directory?
Explain a pre-processor and its advantages.
How can you increase the allowable number of simultaneously open files?
What functions are used in dynamic memory allocation in c?
write a program which the o/p should b in such a way that s triangle if I/p is 3,a Square/rectangle if I/P=4,a pentagon if I/P=5 and so on...forget about the I/P which is less than 3
int i[2], j; int *pi;i[0] = 1; i[1] = 5; pi = i; j = *pi + 1 + *(pi + 1)Value of j after execution of the above statements will be a) 7 b) 6 c) 4 d) pointer
Why do we use c for the speed of light?
What is a example of a variable?
Explain how can you be sure that a program follows the ansi c standard?
Explain what are header files and explain what are its uses in c programming?
What does the && operator do in a program code?