Saturday, 5 March 2022

3. Accept any three numbers and find their squares and cubes.

/* 3.accept any three number and find their squares and cubes */

#include<stdio.h>
#include<conio.h>

void main()
{
    int a, b, c;
    clrscr();

    printf("enter three number:\n");
    scanf("%d %d %d", &a, &b, &c);

    printf("\n\nsquare of %d number is: %d",a,a * a);
    printf("\nsquare of %d number  is: %d",b, b * b);
    printf("\nsquare of %d number is: %d",c,c * c);

    printf("\n\ncube of %d number is: %d",a,a * a * a);
    printf("\ncube of %d number is: %d",b,b * b * b);
    printf("\ncube of %d number is: %d",c,c * c * c);

    getch();
}

/*      output:

enter three number:
12
13
14


square of 12 number is: 144
square of 13 number  is: 169
square of 14 number is: 196

cube of 12 number is: 1728
cube of 13 number is: 2197
cube of 14 number is: 2744

*/ 

No comments:

Post a Comment

python programs

1. sum of two number