diff --git a/Algorithms/Array/Move Zeroes to The End.cpp b/Algorithms/Array/Move Zeroes to The End.cpp new file mode 100644 index 000000000..79b1d9897 --- /dev/null +++ b/Algorithms/Array/Move Zeroes to The End.cpp @@ -0,0 +1,38 @@ +#include +using namespace std; +int main() +{ + int n; + int a[100]; + int i=0; + int j=n-1; + int cnt=0; + cout<<"Enter the size of the array: "; + cin>>n; + cout<<"Enter the array Elements: "; + for(int i=0;i>a[i]; + } + for(i=0;i=0;j--){ + if(a[j]!=0){ + int temp=a[i]; + a[i]=a[j]; + a[j]=temp; + break; + } + else{ + cout<<"All Elements are 0s."; + }}}} + for(i=0;i +using namespace std; +int main() +{ + int n; + int a[100]; + int i=0; + int j=0; + int cnt=0; + int n1=0; + int n2=0; + cout<<"Enter the size of the array: "; + cin>>n; + cout<<"Enter the array Elements: "; + for(i=0;i>a[i]; + } + int pro=a[0]*a[1]; + for(i=0;ipro){ + n1=a[i]; + n2=a[j]; + pro=a[i]*a[j]; + } + } + } + cout<<"The 1st number is "<