Saturday, October 24, 2020

If the given number is positive, display the square and the cube otherwise display an error (C program)

#include <stdio.h>

int main() {

    int n;

    printf("Enter a number:");

    scanf("%d",&n);

    if(n>0)

    {

        printf("Square=%d, Cube=%d",n*n,n*n*n);

    }

    else

    {

        printf("Enter a positive number");

    }

}

No comments:

Post a Comment

SAP Tcodes

zme27 - Automatic STO creation mmbe - Stock Overview, Material, Batch me51n - Create Purchase Requisition me21n - Create Purchase Order me59...