Posts

Showing posts with the label Math

C program to find Transpose of Matrix.

This blog has been migrated to learn c programming for beginners Write a C program to find Transpose of Matrix  This C program prints the Transpose of supplied Matrix. C Program source code #include<stdio.h> #include<conio.h> #define MAX 100 int main() {  int i,j,r,c,m[MAX][MAX];  printf("Enter the order of matrix:\n");  scanf("%d%d",&c,&r);  printf("Enter a %d*%d matrix:\n",c,r);  for(i=0;i<c;i++)  {   for(j=0;j<r;j++)   {    scanf("%d",&m[i][j]);   }  }  printf("Matrix before transpose:\n");  for(i=0;i<c;i++)  {   for(j=0;j<r;j++)   {    printf("%d\t",m[i][j]);   }   printf("\n");  }  printf("Matrix after transpose:\n");  for(j=0;j<r;j++)  {   for(i=0;i<c;i++)   {    printf("%d\t",m[i][j]);   }   printf("\n");  }  getch();  return(0); }   You can Browse related article below for more information and program code related to different math op

C program to check if the supplied year is leap year or not.

This blog has been migrated to learn c programming for beginners Write a C program to check if the supplied year is leap year or not.  This C program check if the supplied year is leap year or not. C Program source code #include<stdio.h> #include<conio.h> int main() {  int y;  printf("Enter a year:\n");  scanf("%d",&y);  if(y%400==0)  {   printf("Its a leap year.");  }  else if(y%100==0)  {   printf("Its not a leap year,");  }  else if(y%4==0)  {   printf("Its a leap year,");  }  else  {   printf("Its not a leap year,");  }  getch();  return(0); } You can Browse related article below for more information and program code related to different math operation.  Does above is helpful , Post you views in comment DO NOT MISS OTHER C PROGRAMMING TUTORIAL * indicates required Email Address * C program to check if the supplied year is leap year or not.

C program to print even numbers between given two numbers.

This blog has been migrated to learn c programming for beginners Write a C program print even numbers between given two numbers. This C program prints the even number between the two number supplied by user C Program source code #include<stdio.h> #include<conio.h> int main() {  int i,n1,n2;  printf("Enter any two numbers:\n");  scanf("%d%d",&n1,&n2);  for(i=n1;i<=n2;i++)  {   if(i%2==0)   {    printf("%d\t",i);   }  }  printf("\nThese are the even numbers between those two numbers.");  getch();  return(0); } You can Browse related article below for more information and program code related to different math operation.  Does above is helpful , Post you views in comment DO NOT MISS OTHER C PROGRAMMING TUTORIAL * indicates required Email Address * C program to print even numbers between given two numbers.

Cube sum program of individual digit of number in c with description

Image
What is cube sum program written in c ? In cube sum program , we  find cube of individual digit of a number and find their sum .for example: 123 =  1^3 + 2 ^3 + 3^3. Cube of individual digit have to be found for that we have to extract each digit .As we know last digit of number can be extract using modulus division (i.e 123%10 = 3 ) , And if we do integer division of given number by 10 , we can get other digit excluding last digit . Code of  cube sum program: // Cube sum program  of individual digit of number in c start #include <stdio.h>   #include <conio.h> int main () {    int number ;    printf ( " enter a number to find cube sum " );      scanf ( "%d" , & number );      int n2,cube,cubesu = 0;    while ( number!=0 )      {         n2 = number % 10;         cube = n2 * n2 * n2;         cubesu = cubesu + cube;         number = number / 10;         }     printf ( "cube sum is %d\t" , cubesu );     getch ();