PRINTING ASCII VALUE USING C PROGRAM

PRINTING ASCII VALUE USING C PROGRAM

PRINTING ASCII VALUE USING C PROGRAM



Solution:

#include<stdio.h>
void main(){
  int i;
  for(i=0;i<=255;i++){
            printf("%d -> %c ",i,i);
  }
  return 0;
}

More C Program :


  1. PRINTING ASCII VALUE USING C PROGRAM
  2. write a c program to print ascii value of all characters
  3. how to check ascii value in c
  4. c program to find ascii value of all character
  5. c program to find ascii value of a number
  6. write a c program to print ascii value of given character
  7. c program to read a character and print its ascii value
  8. c program to print ascii value of any character
  9. c program to print ascii value of alphabets
MULTIPLICATION OF TWO MATRICES USING C PROGRAM

MULTIPLICATION OF TWO MATRICES USING C PROGRAM

MULTIPLICATION OF TWO MATRICES USING C PROGRAM


Solution:

#include<stdio.h>
int main(){
  int a[5][5],b[5][5],c[5][5],i,j,k,sum=0,m,n,o,p;
  printf("\nEnter the row and column of first matrix");
  scanf("%d %d",&m,&n);
  printf("\nEnter the row and column of second matrix");
  scanf("%d %d",&o,&p);
  if(n!=o){
      printf("Matrix mutiplication is not possible");
      printf("\nColumn of first matrix must be same as row of second matrix");
  }
  else{
      printf("\nEnter the First matrix->");
      for(i=0;i<m;i++)
      for(j=0;j<n;j++)
           scanf("%d",&a[i][j]);
      printf("\nEnter the Second matrix->");
      for(i=0;i<o;i++)
      for(j=0;j<p;j++)
           scanf("%d",&b[i][j]);
      printf("\nThe First matrix is\n");
      for(i=0;i<m;i++){
      printf("\n");
      for(j=0;j<n;j++){
           printf("%d\t",a[i][j]);
      }
      }
      printf("\nThe Second matrix is\n");
      for(i=0;i<o;i++){
      printf("\n");
      for(j=0;j<p;j++){
           printf("%d\t",b[i][j]);
      }      
      }
      for(i=0;i<m;i++)
      for(j=0;j<p;j++)
           c[i][j]=0;
      for(i=0;i<m;i++){ //row of first matrix
      for(j=0;j<p;j++){  //column of second matrix
           sum=0;
           for(k=0;k<n;k++)
               sum=sum+a[i][k]*b[k][j];
           c[i][j]=sum;
      }
      }
  }
  printf("\nThe multiplication of two matrix is\n");
  for(i=0;i<m;i++){
      printf("\n");
      for(j=0;j<p;j++){
           printf("%d\t",c[i][j]);
      }
  }
  return 0;
}

More C Program :


  1. MULTIPLICATION OF TWO MATRICES USING C PROGRAM
  2. program for matrix multiplication
  3. c program for multiplication of two matrices using arrays
  4. c program for multiplication of two matrices using pointers
  5. c program for multiplication of two matrices using functions
  6. c program for multiplication of two matrices using dynamic memory allocation
  7. c program to find multiplication of two matrices using arrays
  8. write a c program for multiplication of two matrices using dynamic memory allocation
  9. c program for multiplication of two matrices with output
FIND OUT SUM OF DIAGONAL ELEMENTS OF A MATRIX USING

FIND OUT SUM OF DIAGONAL ELEMENTS OF A MATRIX USING

FIND OUT SUM OF DIAGONAL ELEMENTS OF A MATRIX USING


Solution:


#include<stdio.h>
int main(){
  int a[10][10],i,j,sum=0,m,n;
  printf("\nEnter the row and column of matrix");
  scanf("%d %d",&m,&n);
  printf("\nEnter the First matrix->");
  for(i=0;i<m;i++)
      for(j=0;j<n;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("%d\t",a[i][j]);
      }
 }
 for(i=0;i<m;i++){
     for(j=0;j<n;j++){
          if(i==j)
              sum=sum+a[i][j];
     }
 }
 printf("\n\nSum of the diagonal elements of a matrix is -> ");
 printf("%d",sum);
 return 0;
}

More C Program :


  1. FIND OUT SUM OF DIAGONAL ELEMENTS OF A MATRIX USING
  2. sum of both diagonal elements of a matrix in c
  3. sum of diagonal elements of a matrix in java
  4. sum of diagonal elements of a matrix in c++
  5. sum of right diagonal matrix in c
  6. program to calculate sum of diagonals of a matrix
  7. sum of diagonal elements of a matrix in matlab
  8. diagonal elements of a matrix python
  9. sum of diagonal elements of a square matrix