
Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!

#include <stdio.h> int main() { double r = 4.2; /* sorry for typo, putting V instead of r / / put answer below / double pi = 3.14159265358979; / donโt need this many digits / double V; V = (4.0/3.0)pirrr; / note: (4/3) == 1 / printf("V = %.5f\n", V); / or %0.5f or %9.5f etc. */ }
#include <stdio.h> int main() { int a, b; /* remember: a and b are integers / a = 2 + 34; printf("a = %d\n", a); b = 2*3 + 15%4 + 1/4; printf("b = %d\n", b); }
#include <stdio.h> int main() { int income, tax; scanf("%d", &income); tax = 500; if (income < 8000) tax = 1000; else if (income <= 10000) tax = 1500; else if (income <= 12000) tax = 2000; else tax = 2500; printf("Income: %d, tax: %d\n", income, tax); }