* write a program input, Square of the number.
#include<stdio.h>
#include<conio.h> void main( ) { int num,square; clrscr( ); num = 7; square = num * num; printf("the square of a number is : %d ",square); getch( ); } |
Output:-
the square of a number is : 49 |
#include<stdio.h>
#include<conio.h> void main( ) { int n,qube; clrscr( ); n = 3; qube = n * n * n; printf("the qube of a number is : %d ",qube); getch( ); } |
Output:-
the qube of a number is : 27 |
* Write a Program input,Base and Height of a Triangle, calculate area of Triangle.
#include<stdio.h> #include<conio.h> void main( ) { int b,h; float area; clrscr( ); b = 5; h = 4; area =1/2 * b * h; printf("Area of Triangle is : %f",area); getch( ); } |
Output:-
Area of Triangle is: 10.000000 |
__________________________________________________________________________________
__________________________________________________________________________________
__________________________________________________________________________________
Post a Comment