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();
}
| 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();
}
Beta Loop Lgna Tha
ReplyDelete