home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C Programming Starter Kit 2.0
/
SamsPublishing-CProgrammingStarterKit-v2.0-Win31.iso
/
tybc4
/
if1.cpp
< prev
next >
Encoding:
Amiga
Atari
Commodore
DOS
FM Towns/JPY
Macintosh
Macintosh JP
NeXTSTEP
RISC OS/Acorn
Shift JIS
UTF-8
Wrap
C/C++ Source or Header
|
1993-03-19
|
274 b
|
15 lines
// Program demonstrates the single-alternative if statement
#include <iostream.h>
main()
{
double x;
cout << "Enter a non-zero number : ";
cin >> x;
if (x != 0)
cout << "The reciprocal of " << x
<< " is " << (1/x) << "\n";
return 0;
}