Posts

Showing posts from November, 2017

Area and Perimeter of circle program in c

Area and Perimeter of circle program in c /*C program to find area and perimeter of circle.*/ # include < stdio.h > # define PI 3 . 14f int main ( ) { float rad , area , perm ; printf ( " Enter radius of circle: " ) ; scanf ( " %f " , & rad ) ; area = PI * rad * rad ; perm = 2 * PI * rad ; printf ( " Area of circle: %f \n Perimeter of circle: %f \n " , area , perm ) ; return 0 ; }

a program in C to input a number and print its arithmetic table upto 10.

Example #1: Multiplication Table Up to 10 #include <stdio.h> int main () { int n , i ; printf ( "Enter an integer: " ); scanf ( "%d" ,& n ); for ( i = 1 ; i <= 10 ; ++ i ) { printf ( "%d * %d = %d \n" , n , i , n * i ); } return 0 ; }