Wednesday, May 8, 2019

Function pointer

  • Problem Description

    Write a program in C to show how a function returning pointer using greater of two numbers
  • Test Case 1

    Input (stdin)
    9 8

    Expected Output
    The number 9 is larger
  • Test Case 2

    Input (stdin)
    -1 -8

    Expected Output
    The number -1 is larger
Solution

#include <stdio.h>
int main()
{
int a,b;
  scanf ("%d%d",&a,&b);
  printf ("The number %d is larger",a);
return 0;
}

No comments:

Post a Comment

Parity

Problem Description Ram and Sita playing the parity game. Two types of parity are there. One is odd parity and next is even parity. Ram will...