Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

Design a program using an array that searches a number if it
is found on the list of the given input numbers and locate
its exact location in the list.

Answer Posted / ashwin kumar

dear no need of pointer for the above Question dear

#include<stdio.h>
#include<conio.h>
void main()
{
int ch[100],m,n,flag=0;
printf("enter the limit value");
scanf("%d",&m);
for(int i=0;i<m;i++)
scanf("%d",&a[i]);
printf("enter the number u are searching for :");
scanf("%d",&n);
for(i=0;i<m;i++)
{
if(a[i]==n)
{
printf("%d number is found at the position %d in the
given array ",n,i);
i=m;// to come out from the loop when we found
searching number
flag=1;

}
}


if( flag = 0)
{
printf(" given number is not found in the list of array");

}




getch();
}

Is This Answer Correct ?    0 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Compare array data type to pointer data type

965


Program to find the sum of digits of a given number until the sum becomes a single digit. (e.g. 12345=>1+2+3+4+5=15=>1+5=6)

1094


how we can make 3d venturing graphics on outer interface

4727


How to write c functions that modify head pointer of a linked list?

934


Give differences between - new and malloc() , delete and free() ?

1039


what do you mean by enumeration constant?

954


main(){char *str;scanf("%s",str);printf("%s",str); }The error in the above program is: a) Variable 'str' is not initialised b) Format control for a string is not %s c) Parameter to scanf is passed by value. It should be an address d) none

1298


Explain what is a 'null pointer assignment' error? Explain what are bus errors, memory faults, and core dumps?

1046


What is the use of #include in c?

1032


What does 3 mean in texting?

1026


Is there a way to switch on strings?

1027


Explain is it valid to address one element beyond the end of an array?

1147


What is the stack in c?

1078


What is meant by initialization and how we initialize a variable?

1000


In a switch statement, explain what will happen if a break statement is omitted?

995