Thread: I am new in c programming.How can i solve this problem

  1. #1
    Registered User
    Join Date
    Nov 2017
    Posts
    22

    I am new in c programming.How can i solve this problem

    Squere number storing 10 number into two dimensional array & Print Only Prime Number.

  2. #2
    Registered User
    Join Date
    Jun 2017
    Posts
    88
    It helps a lot if you try to write what code you are able to write, post the code, then ask for help on what parts you do not understand. If you don't know how to get started, perhaps this similar code I wrote might help you.
    Code:
    #include <stdio.h>
     
    int main(void) {
        int arr[2][10] = { 0 };
     
        for (int i = 0; i < 10; ++i) {
            arr[0][i] = i;
            arr[1][i] = arr[0][i] * 10;
        }
        
        for (int i = 0; i < 10; ++i) {
            printf("%5d", arr[0][i]);
            printf("%5d", arr[1][i]);
            if (arr[0][i] % 2 == 0) {
                printf("%8s", "even");
            }
            puts("");
        }
    }
    Output:
    Code:
        0    0    even
        1   10
        2   20    even
        3   30
        4   40    even
        5   50
        6   60    even
        7   70
        8   80    even
        9   90
    Press any key to continue . . .
    Last edited by jack jordan; 11-14-2017 at 02:57 PM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 5
    Last Post: 04-21-2015, 10:25 PM
  2. Replies: 1
    Last Post: 10-14-2014, 06:35 AM
  3. Help me solve this programming question please......
    By kavi.84 in forum C Programming
    Replies: 3
    Last Post: 07-10-2012, 05:09 AM
  4. Help me solve this programming error please
    By rushhour in forum C++ Programming
    Replies: 20
    Last Post: 01-03-2009, 02:11 PM
  5. Help to solve this problem
    By Romashka in forum C++ Programming
    Replies: 3
    Last Post: 04-16-2002, 09:32 AM

Tags for this Thread