Answers for "multiplication in c"

C
2

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 = %d\n",n,i,a);

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


    return 0;


}
Posted by: Guest on July-02-2021
1

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
0

multiplication in c

//use the "*"

/*var*/ * /*var*/;
Posted by: Guest on April-20-2020
0

multiplication operator in c

int main()
{
	int a = 5;
	int b = 3;
	int num = a * b;
    printf("%d", num);
}
Posted by: Guest on February-08-2020
0

multiplicationin c

/*Program for multiplying two numbers*/
#include <stdio.h>
int main(){
	int a, b, Product; //declare the variables that will be used, a will store the first number, b second number and Product, product.
    printf("Enter the first number: \n"); //Prompts user to enter the first number.
    scanf("%d", &a);//Accepts input and saves it to variable a
    printf("Enter the second number: \n");
    scanf("%d", &b);
    sum = a * b; //Formular to multiply the two numbers.
    printf("Product is %d\n", product);
}
Posted by: Guest on April-17-2021
0

C multiply

// Program to multiply 2 numbers from user inputs

#include <stdio.h>
int main() {
    double a, b, product;
    printf("Enter two numbers: ");
    scanf("%lf %lf", &a, &b);  
 
    // Calculating product
    product = a * b;

    // Result up to 2 decimal point is displayed using %.2lf
    printf("Product = %.2lf", product);
    
    return 0;
}
Posted by: Guest on September-16-2020

Code answers related to "multiplication in c"

Code answers related to "C"

Browse Popular Code Answers by Language