source file name: Matadd.C #include <stdio.h> int main() { int i,j; int A[3][3]={{1,2,3},{4,5,6},{7,8,9}}; int B[3][3]={{2,2,2},{3,6,9},{10,20,30}}; int C[3][3]; //clrscr(); printf("\n given Matrix A \n"); for(i=0;i<3;i++) { for(j=0;j<3;j++) { printf("%d ",A[i][j]); } printf("\n&…
Read more13) Write a program that displays 2D Matrix which takes input rows and columns of Matrix.
source file name: Matrix1.C #include<stdio.h> int main() { int row,col; int i,j,sum=0,avg; int A[10][5]; //clrscr(); printf("\n enter no. of rows "); scanf("%d",&row); printf("\n enter no. of columns "); scanf("%d",&col); for(i=0;i<row;i++) { printf("\n …
Read more12)Write a program to find average marks of 4 different subjects obtained by 10 student in a test using two dimensional array.
Write a program to find average marks of 4 different subjects obtained by 10 student in a test . Use two dimensional array to store marks of student for each subject. source file name: arr2davg.C #include<stdio.h> int main() { int i,j,sum=0,avg; int stud[10][5]={ {501,15,15,15,15},{502,16,16,16,16},{503,15,16,…
Read more11) Write a program to find average marks obtained by 10 student in a test . Use array to store marks of student.
source file name: arravg.C void main() { int i,n,sum=0,avg; int A[20]; clrscr(); printf("\n enter marks out of 25 "); printf("enter no. of students attempted in Test <20:\n"); scanf("%d",&n); for(i=0;i<n;i++) { printf("\n enter marks of %d student: ",i+1); scanf(&quo…
Read more7) Write a program that converts decimal integer number to binary equivalent using Array.
source file name: BinaryConv.C void main() { int i,n; int rem[15];; clrscr(); printf("enteu any Natural number :\n"); scanf("%d",&n); i=0; while(n>0) { rem[i]=n%2; n=n/2; i++; } printf("\nBinary Conversion :\n"); for(i=i-1;i>=0;i--) printf("%d ",rem[i]); getch(); } …
Read more8) Write a program that converts decimal integer number to Octal equivalent using Array.
source file name: Conv8.C void main() { int i,n; int rem[15];; //clrscr(); printf("\n enteu any Natural number :\n"); scanf("%d",&n); i=0; while(n>0) { rem[i]=n%8; n=n/8; i++; } printf("\n Octal Conversion :\n"); for(i=i-1;i>=0;i--) printf(" %d ",rem[i]); getch(); …
Read more10)Write a program that converts any decimal integer number to binary, octal and hexadecimal equivalents using function that converts decimal number to any base equivalent.
source file name: Convallfn.C void main() { void conv(int n, int b); int n; clrscr(); printf("\n enteu any Natural number :\n"); scanf("%d",&n); conv(n,2); conv(n,8); conv(n,16); getch(); } void conv(int n, int b) { int rem[15]; int i=0; while(n>0) { rem[i]=n%b; n=n/b; i++; } if(b==2) prin…
Read more9) Write a program that converts decimal integer number to Hexadecimal equivalent using Array.
source file name: Conv16.C void main() { int i,n; int rem[15];; clrscr(); printf("\n enteu any Natural number :\n"); scanf("%d",&n); i=0; while(n>0) { rem[i]=n%16; n=n/16; i++; } printf("\n Octal Conversion :\n"); for(i=i-1;i>=0;i--) { switch(rem[i]) { case 10:printf("A …
Read more6)Write a program that sorts given integers and display in Ascending order also print the integers in Descending order.
source file name: ArrSort.C void main() { int i,j,temp; int A[]={11,-20,23,77,-18,134,-53,500,6,100}; clrscr(); printf("unsoted given array numbers no :\n"); for(i=0;i<10;i++) printf("%d ",A[i]); for(i=0;i<10;i++) { for(j=0;j<10;j++) { if(A[i]>A[j]) { temp=A[i]; A[i]=A[j]; A[j]=temp; }…
Read moreWrite a program that displays sum of all given array numbers. Given array numbers are: 100,150,-170,240,120 source file name: Arraysum.C void main() { int S[]={100,150,-170,240,120}; int i,sum=0; clrscr(); printf("\nArray numbers are: "); for(i=0;i<5;i++) { printf(" %d ",S[i]); } printf("…
Read moreWrite a program that finds and print each array element added by 7 value. Given array numbers are:10,15,20,25,30. source file name: Arradded.C #include<stdio.h> int main() { int P[]={10,15,20,25,30}; int i; //clrscr(); printf("\nArray numbers are: "); for(i=0;i<5;i++) { printf(" %d ",P[…
Read more3)Write a program that finds and displays square and cubes of each array element.
Write a program that finds and displays square and cubes of each array element. Given array numbers are : 10,15,-17,24,12 source file name: Arrsqcube.C #include<stdio.h> int main() { int A[]={10,15,-17,24,12}; int i,sq,c; //clrscr(); printf("\nArray numbers are: "); for(i=0;i<5;i++) { printf(&quo…
Read more2) Write a C program that displays odd and even numbers from input Array numbers.
source file name: Array3.C #include<stdio.h> int main() { int n[10],i; int ps=0,ng=0,odd=0,even=0; //clrscr(); printf(" Input 10 integers "); for(i=0;i<10;i++) { scanf("%d ",&n[i]); } for(i=0;i<10;i++) { if(n[i]>0) ps++; else ng++; if(n[i]%2==0)…
Read more1) Write a C program that displays array numbers in forward and reverse direction.
source file name: Array1.C #include<stdio.h> int main() { int A[5]={10,20,30,40,50}; int i; //clrscr(); printf("\n Array in forward direction"); for(i=0;i<5;i++) printf("%d ",A[i]); printf("\n Reverse direction"); for(i=4;i>=0;i--) printf("%d &quo…
Read more