SoFunction
Updated on 2025-03-06

Addition of basic tutorials for C language rookies

Write the program first:

#include <>

int main()
{
  int a = 1;
  int b = 2;
  int c = a + b;
  printf("sum is %d\n", c);
  
  return 0;
}

Running results:

sum is 3

Program Analysis:

First define an integer variable a and assign 1 to a.
Define an integer variable b and assign 2 to b.
Finally, define an integer variable c. Its value is not worthy of assignment, but assigns the value after adding a and b to it, that is, the value of c is 3.