C語言可以通過使用基本的算術運算符(+、-、*、/)來實現簡單的數值運算。
下面是一些示例代碼:
int a = 5;
int b = 3;
int sum = a + b;
printf("Sum: %d\n", sum);
int a = 5;
int b = 3;
int difference = a - b;
printf("Difference: %d\n", difference);
int a = 5;
int b = 3;
int product = a * b;
printf("Product: %d\n", product);
int a = 6;
int b = 2;
int quotient = a / b;
printf("Quotient: %d\n", quotient);
這些代碼示例只是簡單的演示了數值運算的基本概念。實際中,可以根據具體的需求使用更復雜的數學表達式和算法進行數值運算。