Thursday, September 13, 2018

POINTER -10

  • Problem Description

    Write a program to add two integers using functions use call by address technique of passing parameters and also illustrate the concept of pointer variables can be used to access the strings.

    Input and Output Format:

    Refer sample input and output for formatting specification.

    All float values are displayed correct to 2 decimal places.

    All text in bold corresponds to input and the rest corresponds to output.

  • CODING ARENA
  • #include <stdio.h>
    int main()
    {
      int a,b,c;
      scanf("%d%d",&a,&b);
      c=a+b;
      printf("The sum of the numbers is %d",c);
      printf("\nAccessing a string using pointer\nHello");

    return 0;
    }
  • Test Case 1

    Input (stdin)
    6
    
    7
    
    
    Expected Output
    The sum of the numbers is 13
    
    Accessing a string using pointer
    
    Hello
  • Test Case 2

    Input (stdin)
    9
    
    10
    
    
    Expected Output
    The sum of the numbers is 19
    
    Accessing a string using pointer
    
    Hello

No comments:

Post a Comment