Answers for "coding of multiplication table of 2 in c"

C
3

multiplication table using c

#include <stdio.h>

int main(){
	//declaring variables
    int n,i,a,start,end;
    //taking and printing the instructions
    printf("Enter first number from where you want to start multiplication : n");
    scanf("%d",&start);
     printf("Enter Last number from where you want to end multiplication : n");
    scanf("%d",&end);
  	//using loops

    for(n=start;n<=end;n++){
        a=0;
        for(i=1;i<=10;i++){
            a+=n; //setting the value of a. i used addition instead of multiplication
          //because computer takes too much time for multiplating numbers than doing addition
          
            printf("%d x %d = %dn",n,i,a);

        }
        printf("Multiplication has ended of %dnn",n);
    }


    return 0;


}
Posted by: Guest on July-02-2021
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 = %dn", b, a, a*b);
    }
}
Posted by: Guest on April-19-2021

Code answers related to "coding of multiplication table of 2 in c"

Code answers related to "C"

Browse Popular Code Answers by Language