Thread: to assign a double and output it

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #18
    Registered User
    Join Date
    Jul 2022
    Posts
    78
    just practicing

    Code:
        char *char_1 = "char1";
        char *char_2 = "char2";
        char *char_3 = "char3";
    
    
        int int_1;
        int int_2;
        int int_3;
    
    
    
    
    
        char *array_1[3] = {char_1, char_2, char_3};
    
    
        printf("%s\n", array_1[0]);
        printf("%s\n", array_1[1]);
        printf("%s\n", array_1[2]);
        printf("\n");
    
    
        for(int_1 = 0; int_1 < 3; int_1++)
            printf("%s\n", array_1[int_1]);
            printf("\n");
    
    
        for(int_2 = 2; int_2 > -1; int_2--)
            printf("%s\n", array_1[int_2]);
            printf("\n");
    
        for(int_3 = 0; int_3 < 3; int_3++)
            printf("%s " "%s " "%s\n", array_1[int_3],array_1[int_3],array_1[int_3]);
    Last edited by WaterSerpentM; 10-19-2023 at 06:57 PM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. cant get a double type output ??
    By hummingdev in forum C Programming
    Replies: 3
    Last Post: 04-01-2014, 04:13 PM
  2. double/float output is inaccurate.
    By slee8251 in forum C Programming
    Replies: 8
    Last Post: 03-13-2012, 01:27 AM
  3. Comma instead of period in Double output
    By trillykins in forum C Programming
    Replies: 1
    Last Post: 11-19-2010, 09:29 AM
  4. Double output!
    By Spurnout in forum C++ Programming
    Replies: 3
    Last Post: 11-02-2002, 03:35 AM
  5. Floating points and Double output
    By bman1176 in forum C++ Programming
    Replies: 2
    Last Post: 10-11-2001, 12:24 AM

Tags for this Thread