Canna

Sunday, 23 September 2018

Cube of a Number

Problem Description

Write a C program to find the cube of a number


  • Test Case 1

    Input (stdin)
    2
    
    
    Expected Output
    8
  • Test Case 2

    Input (stdin)
    5
    
    
    Expected Output
    125
  • Program
  • #include <stdio.h>
    int main()
    {
      int a;
      int c;
      scanf("%d",&a);
      c=a*a*a;
      printf("%d",c);
    
     return 0;
    }

No comments:

Post a Comment

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