Answers for "19.write a program in c to display the multiplication table of a given integer."

C
0

c program to print the multiplication table

#include <stdio.h>
int main(){
    int a, b, c, e;
    printf("Enter table format: \n");
    scanf("%d", &a);
    printf("Enter end of table: \n");
    scanf("%d", &e);
    for(b = 0; b <= e; b++){
        printf("%d * % d = %d\n", b, a, a*b);
    }
}
Posted by: Guest on April-19-2021
5

multiplication table in c

#include <stdio.h>
int main()
{
    // declaring table
    int table[10][10];


    int sum = 0;
    // loop
    for(int i = 0; i < 10; i++){
        printf("%d table starting \n\n",i + 1);
        for(int j = 0; j < 10; j++){
             // using addition instead of multiply for better performance
            sum += (i + 1);
            //
            table[i][j] = sum;
            // printing table
            printf("%d x %d = %d \n",i + 1,j + 1,table[i][j]);
        }
        sum = 0;
        printf("\n");
    }

}
Posted by: Guest on June-24-2021

Code answers related to "19.write a program in c to display the multiplication table of a given integer."

Code answers related to "C"

Browse Popular Code Answers by Language