Showing posts with label calculate. Show all posts
Showing posts with label calculate. Show all posts

Online Body Mass Index Calculator - How to Calculate My BMI

Want to calculate your BMI? We shall see what is BMI and how to calculate it. Body Mass Index (BMI) is a measure of body fat based on your weight with respect to your height.



where weight is in kilograms and height in centimeters.

BMI can be used to tell whether you are underweight, normal, overweight or obese. You can calculate your Body Mass Index here using our online BMI calculator.



Weight (in kg):
Height (in centimeters):

C program to Calculate Permutations and Combinations (nPr and nCr)

This is a C program to calculate total number of permutations and combinations for given values of n and r. This program calculates nPr and nCr using functions.

#include <stdio.h>
#include <conio.h>
#include <stdlib.h>
long double fact( int);
int ncr( int ,int);
long npr( int ,int);
main()
{
int n,r;
printf(" Enter value of n & r \n");
scanf("%d %d",&n ,&r);
if( n>= r)
{
printf( "%d C %d is %d \n",n,r,ncr( n ,r));
printf("%d P %d is %ld\n",n,r,npr( n, r));
}
else
{
printf("\n n should be greater than r");
getch ();
exit(0);
}
}


C Program to Calculate Determinant of Matrix of Order Upto 3

In this post i am sharing a C program to calculate determinant of matrices of order upto 3 (3x3).

#include<stdio.h>


void main()

{int a[10][10],i,m,j;

int det=0; 

printf("\nEnter the order of matrix:\n "); 

scanf("%i",&m);

printf("\nenter elements\n");

for(i=0;i<m;i++)

{
for(j=0;j<m;j++)
scanf("%d",&a[i][j]); }

printf("\nThe matrix is\n");

for(i=0;i<m;i++)

{
printf("\n");

for(j=0;j<m;j++)
printf("%3d",a[i][j]);

}

printf("\nthe transpose is\n");

for(i=0;i<m;i++)
{
for(j=0;j<m;j++)

printf("%3i",a[j][i]);

printf("\n");

}

if(m==1)

{
det=a[0][0];

printf("det=%i",det);

}