Wednesday, July 20, 2011

A C language program for multiply numbers

Now we write a program that takes three floating point variables from the user and then print the product of three numbers on the output screen.
C Program:-


#include<stdio.h>
#include<conio.h>
void main(void)
{
clrscr();
float num1,num2,num3;
float answer;
printf("Enter the first number = ");
scanf("%f",&num1);

printf("\n Enter the second number = ");
scanf("%f",&num2);
printf("\n Enter the third number = ");
scanf("%f",&num3);


answer=num1*num2*num3;
printf("The product is =%f",answer);
getch();
}


Output:-
                   Enter the first number= 3
                   Enter the second number= 2
                   Enter the third number = 2
                   The product is =12

No comments:

Post a Comment