Adding 2 numbers – (Declaring integer variables, Watching Variables)

0002-ADDING 2 integers , 5 and 6 no output

Exercise 1 

  1. Write code which declares 2 integer variables A and B .  Initialize A to 5 and B to 6.  Use a third variable , C to store the result of A+B.  

  2. Verify addition has occurred by using the variable watch window.

Demonstration Video

Download the files here:


#include <stdio.h>
#include <stdlib.h>

int main()
   //declare and identify variables
   int a,b;
   int c;

   //Initialize the variables

   //Perform processing c <-- a+b


© 2021  Vedesh Kungebeharry. All rights reserved. 

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s