You should break your bad habits ASAP. It'll only be harder later on:
Code:
#include<stdio.h>
#include<conio.h>
Put your space after "#include" instead of before (e.g. "#include <stdio.h>"). Also, conio.h is a non-standard header and it's best to avoid those when possible.
main() should be defined as: int main(void) unless you want to accept command-line arguments, which you're not.
Code:
{
int i,x,y,b=0,*a;
Try to use meaningful variable names. It will avoid a lot of mistakes once your programs get larger. Using i for a counter variable is fine as long as you consistently do it, but variables that represent the length of an array or whatever should actually indicate that that's what they do.
Code:
printf("\n Enter the no. of elements available in list : ");
When printing a prompt, follow-up the printf() with a fflush(stdout); because not all environments will print the prompt otherwise.
Code:
scanf("%d",&y);
printf("\n Enter the List : \n");
a = malloc(y);
You should always check the return value of malloc(). And again, isn't array = malloc(array_len); a lot easier to see on first-sight than some non-descript variables?
Code:
printf("\n Enter the number which is to be searched in list : ");
scanf("%d",&x);
Again, x? How about search_val or something?
Code:
if(b) sub();
else subno();
This isn't exactly the greatest use of functions. You're calling them fine, but in larger projects you're not going to want to be jumping all over trying to see what these functions do just to find out that they print a simple message. Also, I always find it helpful to include the user's input in a message like this one. You could even replace both of those lines with a single one: printf("\n The Number %d is %spresent in the list\n", search_val, b ? "" : "not ");
getch() is a non-standard function. Use it for homework problems if you wish, but when you work on larger projects, avoid it.
Code:
sub()
{
printf("\n The Number is present in the list");
}
subno()
{
printf("\n The Number is not present in the list");
}
I know I already suggested not using these functions, but if you do use them, make sure you use them correctly. You should have prototypes for these functions and they should be defined like: void subno(void).