home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga ISO Collection
/
AmigaUtilCD2.iso
/
Programming
/
C
/
SASC6571.LZX
/
tutorial
/
2_2_1.c
< prev
next >
Encoding:
Amiga
Atari
Commodore
DOS
FM Towns/JPY
Macintosh
Macintosh JP
NeXTSTEP
RISC OS/Acorn
UTF-8
Wrap
C/C++ Source or Header
|
1997-03-27
|
486 b
|
20 lines
#include "stdio.h"
main( )
{
float num_one, num_two;
int choice;
printf("Enter the first number: ");
scanf("%f", &num_one);
printf("Enter the second number: ");
scanf("%f", &num_two);
printf("To multiply the numbers enter 0, to add them enter 1: ");
scanf("%d", &choice);
if(choice) printf("The sum of the two numbers is: %f.\n", num_one + num_two); else printf("The product of the two numbers is: %f.\n", num_one * num_two);
}