jituTechnology

jituTechnology

Program to read 5*5 matrix and find sum of diagonal elements and to find sum of diagonal elements and all elements

/*Q.8.Program to read 5*5 matrix and find sum of diagonal elements and to find sum of diagonal elements and all elements Programmed by: Jitendra Kr Yadav Roll: 10116 Date: 2011/04/10*/ #include <stdio.h> #include <conio.h> void main() { int a[5][5]={{1,2,3,4,5},{6,4,2,7,9}, {4,9,4,2,7},{6,4,3,8,9},{4,5,4,3,7}}; int s=0; int i,j; int sum = 0; for(i=0;i<5;i++) {            for(j=0;j<5;j++)            […]

read more

Program to obtain 3*4 matrix and transpose of it.

/*Q.7.Program to obtain 3*4 matrix and transpose of it. Programmed by: Jitendra Kr Yadav Roll : 10116 Date: 2011/04/10*/ #include <stdio.h> #include <conio.h> void main() { int a[3][4] ={{1,2,3,4},{6,4,7,9},{9,4,2,7}}; int c[4][3]; int i,j; for(i=0;i<3;i++) {      for(j=0;j<4;j++)            {            c[j][i] = a[i][j];          }           printf (“\n”);     }            […]

read more

Write a program to declare two matrices in your program. Obtain matrix C=A+B and print it

A=2 1 3 7 6           B= 0 1 2 3 4   8 13 4 0 1             9 1 2 6 7   1 2 3 4 3              4 0 3 7 1 /* A program to declare two matrix […]

read more

Write a program to sort the data in ascending and descending order using selection sort.

/*program to sort the data in  ascending order using selection sort. Programmed by :Jitendra Kumar Yadav roll ni.: 10116 programmed on.: 21st mar,2011*/ #include <stdio.h> #include <conio.h> void main() { int i,j,temp; int arr[10]={2,1,6,5,8,4,9,7,10,3}; for (i=0;i<9;i++) { for (j=i+1;j<9;j++) { if(arr[i]>arr[j])//for descending change > to < { temp = arr[i]; arr[i] = arr[j]; arr[j] = […]

read more

Write a program to sort the data in ascending and descending order using bubble sort.

/*program to sort the data in ascending order using bubble sort. Programmed by :Jitendra Kumar Yadav roll ni.: 10116 programmed on.: 21st mar,2011*/ #include <stdio.h> #include <conio.h> void main() { int i,j,temp; int arr[10]={2,1,6,5,8,4,9,7,10,3}; for (i=0;i<10;i++) { for (j=0;j<10-i;j++) if(arr[j]>arr[j+1])// if you want for descending order then changeif(arr[j]>arr[j+1] to if(arr[j]<arr[j+1] { temp = arr[j]; arr[j] = […]

read more