Read values from keyboard for calculations . And see how scanf() works.
Refer Simple Calculations also.
Output :
Enter a value of x: 3Enter a value of y: 4
z=x*y=12
=========================================================================
Back to Home & C
Refer Simple Calculations also.
#include<stdio.h> #include<conio.h> main() { clrscr(); int x,y,z; printf("Enter a value of x:"); scanf("%d",&x); printf("Enter a value for y:"); scanf("%d",&y); z=x*y; printf("z=x*y=%d\n",z); getch(); return 0; } |
Output :
Enter a value of x: 3Enter a value of y: 4
z=x*y=12
=========================================================================
Back to Home & C