home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C by Discovery (4th Edition)
/
C_By_Discovery_4th_Edition.tar
/
C_By_Discovery_4th_Edition
/
_DISK_
/
ch2
/
mistake1.c
< prev
next >
Wrap
C/C++ Source or Header
|
2005-06-16
|
594b
|
26 lines
/* mistake1.c
*
* Synopsis - Accepts input of a value of type int and issues
* messages about its value.
*
* Objective - To further illustrate that an assignment is
* an expression.
*/
/* Include Files */
#include <stdio.h>
int main( void )
{
int intvar;
printf( "Enter a decimal value : " );
scanf( "%d", &intvar );
if ( intvar = 3 ) /* Note 1 */
printf( "It's THREE!!\n" );
printf( "The value of intvar is %d.\n", intvar );
return 0;
}