שפת C/פעולות חשבוניות: הבדלים בין גרסאות בדף

תוכן שנמחק תוכן שנוסף
Atavory (שיחה | תרומות)
שורה 12:
 
/* Prints 4 + 2 = 6 */
printf("%d + %d = %d\n" %, x, y, x + y);
 
/* Prints 4 - 2 = 2 */
printf("%d - %d = %d\n" %, x, y, x - y);
 
/* Prints 4 * 2 = 8 */
printf("%d * %d = %d\n" %, x, y, x * y);
 
/* Prints 4 / 2 = 2 */
printf("%d / %d = %d\n" %, x, y, x / y);
</source>
 
שורה 30:
 
/* Prints 16 */
printf("%d\n" %, x + y * 3 + 5);
</source>