Search
 
SCRIPT & CODE EXAMPLE
 

C

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 : 
");
    scanf("%d",&start);
     printf("Enter Last number from where you want to end multiplication : 
");
    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 = %d
",n,i,a);

        }
        printf("Multiplication has ended of %d

",n);
    }


    return 0;


}
Comment

c program to print the multiplication table

#include <stdio.h>
int main(){
    int a, b, c, e;
    printf("Enter table format: 
");
    scanf("%d", &a);
    printf("Enter end of table: 
");
    scanf("%d", &e);
    for(b = 0; b <= e; b++){
        printf("%d * % d = %d
", b, a, a*b);
    }
}
Comment

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 

",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 
",i + 1,j + 1,table[i][j]);
        }
        sum = 0;
        printf("
");
    }

}
Comment

a program to print the multiplication table of a given number in c

int n, i;
    printf("Enter a number: ");
    scanf("%d", &n);
    printf("Multiplication table of %d:
 ", n);
    for (i = 1; i <= 10; i++){
        printf("%d x %d = %d
", n, i, n * i);
        }
    return 0;
Comment

PREVIOUS NEXT
Code Example
C :: comment c 
C :: how to print sizes of various data types of C 
C :: merge sort for strings in c 
C :: int_min in c 
C :: read a document in c getting name from console 
C :: add a item to cart woocomerce with quantity 
C :: c in array 
C :: C scanf() to read a string 
C :: putchar in c 
C :: arduino sketch structure 
C :: search in gz file 
C :: c check first character of string 
C :: how to convert int in to const char in c 
C :: fgets c 
C :: pointers to a function in c 
C :: variables in c 
C :: declare string in c 
C :: c print 
C :: eliminare file in c 
C :: increment and decrement operator 
C :: division en java 
C :: 1000000000 
C :: C# special character display 
C :: C program to calculate the sum of odd and even numbers 
C :: c convert float to int 
C :: voide means in c 
C :: String to Integer (atoi) 
C :: findtotalcurtain 
C :: Unix socket I/O primitives 
C :: jock cranley 
ADD CONTENT
Topic
Content
Source link
Name
4+9 =