write a program in c to read array check element is present or
not?
Answer / tatukula
#include<stdio.h>
int main()
{
char array[10]={0,1,2,3,4,5,6,7,8,9};
int check;
int i,flag=0;
printf("enter number you want to check in array\n");
scanf("%d",&check);
for(i=0;i<=sizeof(array);i++)
{
if(array[i] == check)
{
flag = 1;
break;
}
}
if(flag)
printf("element is present in the array\n");
else
printf("element is not present in the array\n");
}
input: 4
output: element is present in the array
input: 45
output: element is not present in the array
| Is This Answer Correct ? | 5 Yes | 0 No |
write a program to display all prime numbers
How do you determine if a string is a palindrome?
Explain spaghetti programming?
what is the use of pointers
What is a Genralised LInked List?? Please give a detailed explation of it..
how we can make 3d venturing graphics on outer interface
what is the use of macro program
Give me the code of in-order recursive and non-recursive.
What is the description for syntax errors?
the expression a=30*1000+2768; evalutes to a) 32768 b) -32768 c) 113040 d) 0
what is the associativity of bitwise OR operator?
what is a static function