Nested Loop in Java (List of Prime Numbers from 1 to N)
class nestedLoopDemo { public static void main(String args[]) { int n, flag, i, j; n=100; j=2; System.out.println("The...
class nestedLoopDemo { public static void main(String args[]) { int n, flag, i, j; n=100; j=2; System.out.println("The...
class breakDemo { public static void main(String args[]) { int i, n=10; for(i=1;i<=n;i++) { if(i==5) continue; ...
class whileLoopDemo{ public static void main(String args[]) { int i=11, n=5; while(i<=n) { System.out.println(i); i+...
//Generate Unique Random Values and Store in Array. #include<iostream> #include<iomanip> #include<time.h> #include<st...
// Program-1 public class DemoIf { public static void main(String args[]) { int marks; String result; marks=20; if(marks>...
public class Block { public static void main(String args[]) { int x=10; blk1: //label {//start of block1 int y=50; ...
public class ArithOperators { public static void main(String args[]) { short x=6; int y=4; float a=12.5f; //suffix f to expli...
#include<stdio.h> int compLength(char s1[], char s2[]) { int l1,l2; for(l1=0;s1[l1]!='\0';l1++); //length of string1 f...
#include<iostream> #include<iomanip> using namespace std; int main() { int ar[11]={19,14,23,22,18,25,17,30,9,17,33}, n=1...
Download the File. Click here to Watch the Explanation & Developing Video
#include<iostream> #include<iomanip> #include<time.h> #include<stdlib.h> using namespace std; void searchArray() { ...
#include<iostream> #include<iomanip> #include<time.h> #include<stdlib.h> using namespace std; void searchArray() { ...
#include<iostream> #include<iomanip> using namespace std; void Pattern1(int n) { int i, j, k, x=1; for(i=1;i<=n;i++) {...
#include<stdio.h> int main() { char pwd[20],ch; char mypwd[]="Hello"; int i=0; printf("Enter Password: "...
''' Following logics in single program. Find the distinct values of array Find the frequency of each number of array. Find all ...
#include<iostream> using namespace std; void shiftNumbers(int a[],int n) { int i,j,k,tmp; for(i=0,j=0;i<n;i++) { if(a[i]==...
#include<iostream> using namespace std; void cyclicRotate(int a[],int n) { int tmp,j; tmp=a[n-1]; for(j=n-1;j>0;j--) { a...
#include<iostream> using namespace std; void swap(int a[][4] ,int r, int c) { int i,j,n=4; for(int i=0;i<r;i++) { for(in...
Download the File. Click here to Watch the Explanation & Developing Video