Results 1 to 4 of 4

Thread: hi

  1. #1
    Junior Member
    Join Date
    Dec 2007
    Answers
    2

    hi

    i need some one to help me in this program

    write a function to find a number of an integers array . the function must return true if the number is existed and false otherwise . then use that function in a program where the user enters the array elements and the number to be found . assume that the array size is 10 .


  2. #2
    Junior Member
    Join Date
    Jul 2007
    Answers
    2

    Re: hi

    #include<stdio.h>
    #include<conio.h>
    int fun(int [],int );
    void main()
    {
    int ary[]={10,20,50,30,40};
    int t,a;
    clrscr();
    printf("Enter any number : ");
    scanf("%d",&t);
    a=fun(ary,t);
    if(a==1)
    printf("true");
    else
    printf("fales");
    getch();
    }

    int fun(int ar[],int i)
    {
    for(int c=0;c<=5;c++)
    if(ar[c]==i)
    {
    return 1;
    }
    else
    {
    return 0;
    }
    }


  3. #3
    Junior Member
    Join Date
    Dec 2007
    Answers
    2

    Re: hi

    thanks so much


  4. #4
    Contributing Member
    Join Date
    Dec 2007
    Answers
    46

    Re: hi

    Quote Originally Posted by bouloskh View Post
    i need some one to help me in this program

    write a function to find a number of an integers array . the function must return true if the number is existed and false otherwise . then use that function in a program where the user enters the array elements and the number to be found . assume that the array size is 10 .
    You need to let us know what is your difficulty in writing a program to match the specifications. Did you not understand the problem OR are you having difficulty in implementing it??

    One can learn programming by thinking about the problem, coming up with a solution and implementing it. Trust me: the reward is worth it. If you have any difficulty in any phase, you should ask. Just asking for a solution does not help.

    Of course, you are free to do as you wish.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
About us
Applying for a job can be a stressful and frustrating experience, especially for someone who has never done it before. Considering that you are competing for the position with a at least a dozen other applicants, it is imperative that you thoroughly prepare for the job interview, in order to stand a good chance of getting hired. That's where GeekInterview can help.
Interact