C program to seek out the transpose of a given matrix
The transpose of a given matrix is formed by exchanging the rows and columns of a matrix. #include <stdio.h> int main() {
C program to display elements of 2d array
# include<stdio.h> void main( ) { int i,j; int a[3][3] = { { 1,2,3}, {4,5,6}, {7,8,9}}; printf("elements of an array \n \n"); for( i=0; i<3;
C program to implement binary search
#include<stdio.h> main() { int a[10],i,n,l,h,m,key; printf("enter the size of array: "); scanf("%d",&n); printf("enter n elements into array: "); for(i=0;i<n;i++) { scanf("%d",&a[i]); } printf("enter the key element: ");
C program to search an element in an array using linear search
#include<stdio.h> main() { int a[10],i,n,key,f=0; printf("enter the size of array: "); scanf("%d",&n); printf("enter n elements into array: "); for(i=0;i<n;i++) { scanf("%d",&a[i]); } printf("enter the key element to
C program to sort given array
#include<stdio.h> main() { int a[10],i,n,j,temp; printf("enter the size of array: "); scanf("%d",&n); printf("enter %d elements into array: ",n); for(i=0;i<n;i++) { scanf("%d",&a[i]); } for(i=0;i<n;i++) { for(j=i;j<n;j++) { if(a[i]>a[j]) { temp=a[i]; a[i]=a[j]; a[j]=temp; } } } printf("the elements in sorted
C program to find maximum and minimum element in an array
#include<stdio.h> main() { int a[10],i,n,max,min; printf("enter the size of array: "); scanf("%d",&n); printf("enter n elements into array: "); for(i=0;i<n;i++) { scanf("%d",&a[i]); } max=a[0]; for(i=0;i<n;i++) { if(a[i]>max) { max=a[i]; } } min=a[0]; for(i=0;i<n;i++) { if(a[i]<min){ min=a[i]; } } printf("the maximum element is %d:
C program to find occurrence of an element in one dimensional array
#include <stdio.h> int main() { int arr[20],n,i; int num,count;printf("Enter total number of elements: "); scanf("%d",&n);//read array elements printf("Enter array elements:\n"); for(i=0;i< n;i++) { printf("Enter
Adding a new row to an existing Pandas DataFrame
There may be situations where we need to insert a new data that we might have missed earlier. There are
Polymorphism in Python
What is Polymorphism? The concept of Polymorphism is taken from the Greek words Poly (many) and morphism (forms). It means the
How to Check for NaN in Pandas DataFrame?
NaN stands for Not A Number and is one of the popular ways to represent the missing value in the