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 pragma in c?
why programs in c are running with out #include
How many parameters should a function have?
Write a program to print fibonacci series without using recursion?
.find the output of the following program? char*myfunc(char*ptr) { ptr +=3; return (ptr); } int main() { char*x,*y; x="HELLO"; y=myfunc(x); printf("y = %s ",y); return 0; }
When should the const modifier be used?
What are valid operations on pointers?
What is the difference between declaring a variable by constant keyword and #define ing that variable?
How can I access an I o board directly?
Why functions are used in c?
Do you know the use of 'auto' keyword?
Explain argument and its types.
How can I pad a string to a known length?
What are types of functions?
Is main an identifier in c?