Operators
/**************************************//* */
/* Operators Demo # 1 */
/* */
/**************************************/
#include
/**************************************/
main ()
{ int i;
printf ("Arithmetic Operators\n\n");
i = 6;
printf ("i = 6, -i is : %d\n", -i);
printf ("int 1 + 2 = %d\n", 1 + 2);
printf ("int 5 - 1 = %d\n", 5 - 1);
printf ("int 5 * 2 = %d\n", 5 * 2);
printf ("\n9 div 4 = 2 remainder 1:\n");
printf ("int 9 / 4 = %d\n", 9 / 4);
printf ("int 9 % 4 = %d\n", 9 % 4);
printf ("double 9 / 4 = %f\n", 9.0 / 4.0);
}
0 comments:
Post a Comment