Home > Back-end >  What a great god help me to look at how to write
What a great god help me to look at how to write

Time:02-27

(1) application arithmetic operators: including +, -, *,/, % and the + +, the decrement - operator, such as

(2) the arithmetic expression oneself write,

(3) data types include: int, float, double, char,

(4) character constants,

(5) the data input from the keyboard, joining instructions for data input and output requirements (as a data is output, one line of text from the keyboard input and output on the screen),

(6) write operation result,

CodePudding user response:

The book did not? At high score topic and simple example, other data types under their research:
 # include & lt; stdio.h> 

Int main ()
{
Int a, b;
Float c, d;
Double e, f;
Char ch, ch1='A';

Printf (" input integer: ");
The scanf (" % d % d ", & amp; A, & amp; B);
Printf (" (+ - */%) b \ n ");
Printf (" a + b=% d \ \ na na - b=% d * b=% d \ \ na na/b=% d % % b=% d \ n ",
A - a + b, b, a * b, a/b, a % b);
+;
b--;
Printf (" +=% d \ n \ nb -=% d ", a, b);

return 0;
}

//run:
//input integer: 5 4
//a (+ - */%) b
//a + b=9
//a - b=1
//a * b=20
//a/b=1
//a % b=1
//+ 6=
//-=3 b
//please press any key to continue...
  • Related