CPS 196 Lecture Notes - Lecture 2: Floppy Disk, Scanf Format String

40 views2 pages

Document Summary

Cis 196 program to experiment with arithmetic operators. #include int main() int x; int y; int z; x = 18; y = 7; z = x % y; printf( x is %d, y is %d, z is %d \n , x,y,z); return 0; Note: be sure to pick a meaningful name for your programs when you save them, and to save them in the appropriate directory on your diskette. It is suggested that you keep a separate directory on your shared drive for each lab. This program will show you the result of using the modulus operator (%). Modify the program to try the other operators, and also try the operators with x, y, and z being of float type and of double type. Note that for float and double type, you need to replace the %d in the printf() statement with %f.

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents

Related Questions