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);这些代码示例只是简单的演示了数值运算的基本概念。实际中,可以根据具体的需求使用更复杂的数学表达式和算法进行数值运算。

