Program help

D

deepan

Hai everybody!

I've recently joined this group.Really amazed at the activity of this
group!

Please somebody could suggest me a c code to search for the no. in a
given array of no.s without using scanf( ) and printf( ).
 
I

Ian Collins

deepan said:
Hai everybody!

I've recently joined this group.Really amazed at the activity of this
group!

Please somebody could suggest me a c code to search for the no. in a
given array of no.s without using scanf( ) and printf( ).
Can you explain that a bit better, maybe avoiding abbreviations?
 
M

Martin Ambuhl

deepan said:
Hai everybody!

I've recently joined this group.Really amazed at the activity of this
group!

Please somebody could suggest me a c code to search for the no. in a
given array of no.s without using scanf( ) and printf( ).

scanf() is used for input,
printf() is used for output.

Neither input nor output is necessary for your task.

We normally refuse to supply answers to what appear to be homework
problems, but
a) A homework problem would probably not have the spurious mention
of scanf and printf, and
b) if this _is_ a homework problem, you probably need to modify
the following so it does not shout to the instructor, "This is
not my work!", and
c) the following might not be doing exactly what you want, anyway.

/* The following function returns a pointer to the sought integer, or
a null pointer if not found */
int * find_the_number( size_t cnt /* # of elements in the array */,
int the_array[],
int the_number)
{
size_t i;
for (i = 0; i < cnt; i++)
if (the_number == the_array) return &the_array;
return 0;
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,780
Messages
2,569,611
Members
45,280
Latest member
BGBBrock56

Latest Threads

Top