any mul table using array

  1. Repeat problem 3 for a general input provided by the user using scanf()



 #include <stdio.h>


int main() {

    // Write C code here

    int n;

    printf("Whose table : ");

    scanf("%d",&n);

    int arr[10];

    for (int i = 0 ; i < 10 ; i++){

        arr[i]=(n*(i+1));

    }

    for (int i = 0 ; i < 10 ; i++){

        printf(" %d X %d = %d\n",n , i+1, arr[i]);

    }

    

    

    return 0;

}

Comments

Popular posts from this blog

Sum of Even Numbers till N

Find the Runner-Up Score!

Print All Substrings