Monday, 26 September 2011

26-09-2011 3rd Addition of Two Variables


 /*This Program takes two values from user, adds them and then shows the result */
#include<stdio.h>
#include<conio.h>
main()
      {
      int val1 , val2, sum;
      printf(" \nPlease enter the first value: ");
      scanf("%d",&val1);
      printf(" \nPlease enter the 2nd value: ");
      scanf("%d",&val2);
      sum = val1 + val2;
      printf(" \nThe Sum of %d and %d is: %d", val1,val2,sum);
      getche();
      return 0;
      }

No comments:

Post a Comment