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 / vignesh1988i

here i have used a concpt of pointers .. ie. array of
pointers.... when you search for a number it may occur once
or more than it... i have designed for all cases.. that's
why i used pointers......................

#include<stdio.h>
#include<conio.h>
void main()
{
int ch[100],m,n,*ptr[20],count=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,k=0;i<m;i++)
{
if(a[i]==m)
{
count++;
ptr[k]=&a[i];
k++;
}
for(i=0;i<count;i++)
printf("the number occured %d times and found to be int
these addresses : %u ",count,*(*(ptr+i)));
getch();
}

Is This Answer Correct ?    1 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Tell me about low level programming languages.

1085


what is different between auto and local static? why should we use local static?

1091


If one class contains another class as a member, in what order are the two class constructors called a) Constructor for the member class is called first b) Constructor for the member class is called second c) Only one of the constructors is called d) all of the above

1015


Why functions are used in c?

1089


What is structure in c explain with example?

1120


How old is c programming language?

977


What is the difference between volatile and const volatile?

951


How do you list a file’s date and time?

1040


writ a program to compare using strcmp VIVA and viva with its output.

1995


Find MAXIMUM of three distinct integers using a single C statement

1025


What is a #include preprocessor?

1100


Write a program to print fibonacci series without using recursion?

1082


using for loop sum 2 number of any 4 digit number in c language

2284


List out few of the applications that make use of Multilinked Structures?

2141


Can we declare function inside main?

971