Monday, April 29, 2019

Square of a Number

  • Problem Description

    Write a C program to find the square of a number
  • Test Case 1

    Input (stdin)
    2

    Expected Output
    4
  • Test Case 2

    Input (stdin)
    5

    Expected Output
    25
Solution

#include <stdio.h>
int main()
{
int a,squ;
  scanf ("%d%d",&a,&squ);
  squ=a*a;
  printf ("%d",squ);
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...