Thread: Help i need array+loop and count C++

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User Marvin Flores's Avatar
    Join Date
    Oct 2012
    Posts
    9

    Question Help i need array+loop and count C++

    Help i need array+loop and count C++

    i need code for count the same value in array



    Ex.
    ____________________________________________
    Enter 10 #:1 2 3 4 4 4 4 4 4 5<---------------for array
    Enter a Number: 4 <------------------entering the same for counting
    Answer :6 <---------------------------- the Result
    ____________________________________________

    this is my code:

    #include <stdio.h>
    int main()
    {
    int a[10],x,z;
    printf("enter a number");
    for(x=0;x<=9;x++)
    {
    scanf("%d" ,&a[x]);
    }
    for(x=0;x<=9;x++)
    {
    }
    printf("enter a number");
    scanf("%d" ,&z);
    if(z==a[x])
    z++;
    printf("answer is %d" ,z);
    {
    }
    }





    plsss help me
    i hope you can help Me !!!!!!!
    Last edited by Marvin Flores; 10-06-2012 at 07:42 AM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Loop count
    By slash.hack in forum C Programming
    Replies: 7
    Last Post: 03-06-2012, 09:21 AM
  2. count bit loop
    By aromash in forum C Programming
    Replies: 2
    Last Post: 03-08-2011, 09:11 AM
  3. While loop to count the charecters of a string
    By simpatico_qa in forum C Programming
    Replies: 11
    Last Post: 04-24-2009, 03:51 AM
  4. Help for some loop count problem..
    By jochen in forum C Programming
    Replies: 3
    Last Post: 11-30-2007, 08:24 AM
  5. homework help. cant get for loop to count right
    By bluegoo06 in forum C++ Programming
    Replies: 11
    Last Post: 03-10-2005, 06:05 PM