Sunday, March 3, 2013

Develop and initialize the given array in a C program that asks User to Enter an integer number for searching. The program witl check the entered number is prsesent in the array or not

Develop and initialize the given array in a C program that asks User to Enter an integer number for searching. The program witl check the entered number is prsesent in the arra or not
                          | 13 | 37 | 52 | 60 | 10 |12 | 15 | 18 | 42 | 25 | 30 | 48 | 20 |

Solution:
/*Develop and initialize the given array in a C program that asks User to Enter an integer number for searching. The program witl check the entered number is prsesent in the arra or not*/
#include<stdio.h>
#include<conio.h>
main()
{
int num[12]={13,37,52,10,12,15,18,42,25,30,48,20},n;
clrscr();
printf("Enter any integer\t");
scanf("%d",&n);
if(n==num[n])
{
printf("\nNumber is present");
}
else
printf("\n Number is not prsent");
getch();
}

                                    For Download Click below

1 comment: