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 are extern variables in c?
Explain 'far' and 'near' pointers in c.
Hai,I have done with my bachelor of commerce and planing to ms,please suggest me how to convince vo for shifting from commerce to computers. Visa on 8 DEC 2014 Npu university
What are header files? What are their uses?
How can I call fortran?
How do you use a pointer to a function?
What is ## preprocessor operator in c?
provide an example of the Group by clause, when would you use this clause
Why is extern used in c?
Is register a keyword in c?
What is 2c dna?
Design a program which assigns values to the array temperature. The program should then display the array with appropriate column and row headings.
What is use of #include in c?
What is the value of h?
Explain what is a program flowchart and explain how does it help in writing a program?