Canna

Saturday, 15 June 2019

Adding two numbers

  • Problem Description

    Add two numbers using pointers
  • Test Case 1

    Input (stdin)
    5
    
    4
    
    
    Expected Output
    The sum of the entered numbers is=9
  • Test Case 2

    Input (stdin)
    9
    
    10
    
    
    Expected Output
    The sum of the entered numbers is=19
  • Program
  • #include <stdio.h>
    int main()
    {
     int a,b,c;
      scanf("%d%d",&a,&b);
      c=a+b;
      printf("The sum of the entered numbers is=%d",c);
     return 0;
    }

No comments:

Post a Comment

Note: only a member of this blog may post a comment.