C Tutorial/Operator/Assignment Operator

Материал из C\C++ эксперт
Версия от 13:32, 25 мая 2010; Admin (обсуждение | вклад) (1 версия: Импорт контента...)
(разн.) ← Предыдущая | Текущая версия (разн.) | Следующая → (разн.)
Перейти к: навигация, поиск

Assignment operator

Assigning the value of an expression to a variable.


<source lang="cpp">var = expression.</source>

The assignment operator is "="

The statement is in the format: Var = expression;


<source lang="cpp">#include <stdio.h> main(){

   int i,j,k;
  
   i = 6;    
   j = 8;
   k = i + j;
  
   printf("sum of two numbers is %d \n",k);

}</source>

sum of two numbers is 14