/* this code should ask for 5 numbers input
then locate 1 input to where it was located
ex. 5 4 3 2 1
enter number to be searched:4
*/
#include <stdio.h>
#include <conio.h>
main() {
int num[5];
int find;
int ctr;
clrscr();
printf("enter a list of numbers:");
scanf("%d%d%d%d%d",&num[5]);
printf("enter a number to be Searched:");
scanf("%d",&find);
for(ctr=1;ctr<=5;ctr++)
if(find=num[ctr]);
{
printf("is found in:%d",ctr);
break;
}
getch();
}
0 comments:
Post a Comment