C language code for multiplication of two numbers



MULTIPLICATION OF TWO NUMBERS

SIMPLE C LANGUAGE CODE FOR MULTIPLICATION OF TWO NUMBERS:

#include<stdio.h>
#include<conio.h>
int main()
{int a, b, c;//we take two integer value
printf("Enter the number :");//use to print the letter, character
scanf("%d%d",&a,&b);//use to scan the accept number and scan it
c=a×b;//arithmetic logical operation, formula
printf("Ans=%d\n", c)/*use to perform operation and display answer*/
getch();
}

And save with extension .c
for eg.
mul.c//mul is the name of the file and .c is an extension of the file.
           In the above example, we can multiply integer numbers, not fractional numbers. for example when output screen comes type two numbers like 2 and press enter then type next numbers like 6 then press enter the answer print on the output screen.
            This code is for integer numbers, if we want to multiply fractional numbers then in above code small changes is there i.e.in the place of int type float and at the place of % d type % f.For multiplication of fractional numbers the code is as follow:

MULTIPLICATION OF TWO FRACTIONAL NUMBERS:
#include<stdio.h>
#include<conio.h>
float main()
{flaot a, b, c;//we take two fractional value
printf("Enter the number :");//use to print the letter, character
scanf("%f%f",&a,&b);//use to scan the accept number and scan it
c=a×b;//arithmetic logical operation, formula
printf("Ans=%f\n", c)/*use to perform operation and display answer*/
getch ();
}


        Friends not only education but also experience is the key to success because we know that practice makes a man perfect.
 
Friends you like maths subject if yes then don't matter but most of my friends don't like maths then love on maths automatically maths love on you. This is simple trick try it and tell me in the comment box you like maths or not.



C language code for multiplication of two numbers C language code for multiplication of two numbers Reviewed by Amit Waghmare on September 16, 2018 Rating: 5

No comments: