forked from Aniket965/Hello-world
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
132 changed files
with
13,756 additions
and
191 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,19 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace HelloWorld | ||
{ | ||
class Program | ||
{ | ||
static void Main(string[] args) | ||
{ | ||
Console.WriteLine("Hello World!"); | ||
Console.ReadKey(); | ||
|
||
|
||
} | ||
} | ||
} | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace HelloWorld | ||
{ | ||
class Program | ||
{ | ||
static void Main(string[] args) | ||
{ | ||
Console.WriteLine("Hello World!"); | ||
Console.ReadKey(); | ||
|
||
|
||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
#include <stdio.h> | ||
|
||
int main() | ||
{ | ||
//Good Bye in Brazilian Portuguese | ||
printf("Vlw flw"); | ||
return 0; | ||
#include <stdio.h> | ||
|
||
int main() | ||
{ | ||
//Good Bye in Brazilian Portuguese | ||
printf("Vlw flw"); | ||
return 0; | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,50 +1,50 @@ | ||
import java.util.Scanner; | ||
|
||
public class BubbleSort { | ||
public static int[] takeInput() | ||
{ | ||
Scanner s = new Scanner(System.in); | ||
System.out.println("Enter the number of elements in the array"); | ||
int n=s.nextInt(); | ||
System.out.println("Enter the array Elements"); | ||
int input[]=new int [n]; | ||
for(int i=0;i<n;i++) | ||
{ | ||
input[i]=s.nextInt(); | ||
} | ||
return input; | ||
} | ||
|
||
public static void printArray(int [] input) { | ||
for(int i=0;i<input.length;i++) | ||
{ | ||
System.out.print(input[i]+ " "); | ||
} | ||
} | ||
|
||
public static void bubbleSort(int[] arr){ | ||
//write your code here | ||
for(int i=0;i<arr.length-1;i++) | ||
{ | ||
for(int j=0;j<arr.length-1-i;j++) | ||
{ | ||
if(arr[j]>arr[j+1]) | ||
{ | ||
int temp=arr[j]; | ||
arr[j]=arr[j+1]; | ||
arr[j+1]=temp; | ||
} | ||
} | ||
} | ||
} | ||
|
||
public static void main(String[] args) { | ||
int input[]=takeInput(); | ||
printArray(input); | ||
bubbleSort(input); | ||
System.out.println(); | ||
printArray(input); | ||
|
||
} | ||
|
||
} | ||
import java.util.Scanner; | ||
|
||
public class BubbleSort { | ||
public static int[] takeInput() | ||
{ | ||
Scanner s = new Scanner(System.in); | ||
System.out.println("Enter the number of elements in the array"); | ||
int n=s.nextInt(); | ||
System.out.println("Enter the array Elements"); | ||
int input[]=new int [n]; | ||
for(int i=0;i<n;i++) | ||
{ | ||
input[i]=s.nextInt(); | ||
} | ||
return input; | ||
} | ||
|
||
public static void printArray(int [] input) { | ||
for(int i=0;i<input.length;i++) | ||
{ | ||
System.out.print(input[i]+ " "); | ||
} | ||
} | ||
|
||
public static void bubbleSort(int[] arr){ | ||
//write your code here | ||
for(int i=0;i<arr.length-1;i++) | ||
{ | ||
for(int j=0;j<arr.length-1-i;j++) | ||
{ | ||
if(arr[j]>arr[j+1]) | ||
{ | ||
int temp=arr[j]; | ||
arr[j]=arr[j+1]; | ||
arr[j+1]=temp; | ||
} | ||
} | ||
} | ||
} | ||
|
||
public static void main(String[] args) { | ||
int input[]=takeInput(); | ||
printArray(input); | ||
bubbleSort(input); | ||
System.out.println(); | ||
printArray(input); | ||
|
||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,63 +1,63 @@ | ||
import java.util.Scanner; | ||
|
||
public class HollowDiamondPattern { | ||
public static void hollowDiamond(int n){ | ||
int ts,space,row=1,col=1; | ||
|
||
while(row<=n) | ||
{ | ||
ts=n-row; | ||
for(space=1;space<=ts;space++) | ||
{ | ||
System.out.print(" "); | ||
} | ||
|
||
int val=row-1; | ||
System.out.print('*'); | ||
for(int i=1;i<=2*val-1;i++) | ||
System.out.print(' '); | ||
|
||
if(val!=0) | ||
System.out.print('*'); | ||
|
||
System.out.println(); | ||
|
||
row++; | ||
} | ||
|
||
row=n-1; | ||
int k=0; | ||
int j=0; | ||
while(row>0) | ||
{ | ||
k++; | ||
for(j=0;j<k;j++) | ||
System.out.print(' '); | ||
|
||
System.out.print('*'); | ||
|
||
int val1=row-1; | ||
for(j=1;j<=2*val1-1;j++) | ||
System.out.print(' '); | ||
|
||
if(val1!=0) | ||
System.out.print('*'); | ||
|
||
System.out.println(); | ||
row--; | ||
} | ||
} | ||
|
||
public static void main(String[] args) { | ||
// TODO Auto-generated method stub | ||
int n; | ||
Scanner s=new Scanner(System.in); | ||
n=s.nextInt(); | ||
hollowDiamond(n); | ||
|
||
|
||
} | ||
|
||
} | ||
|
||
|
||
import java.util.Scanner; | ||
|
||
public class HollowDiamondPattern { | ||
public static void hollowDiamond(int n){ | ||
int ts,space,row=1,col=1; | ||
|
||
while(row<=n) | ||
{ | ||
ts=n-row; | ||
for(space=1;space<=ts;space++) | ||
{ | ||
System.out.print(" "); | ||
} | ||
|
||
int val=row-1; | ||
System.out.print('*'); | ||
for(int i=1;i<=2*val-1;i++) | ||
System.out.print(' '); | ||
|
||
if(val!=0) | ||
System.out.print('*'); | ||
|
||
System.out.println(); | ||
|
||
row++; | ||
} | ||
|
||
row=n-1; | ||
int k=0; | ||
int j=0; | ||
while(row>0) | ||
{ | ||
k++; | ||
for(j=0;j<k;j++) | ||
System.out.print(' '); | ||
|
||
System.out.print('*'); | ||
|
||
int val1=row-1; | ||
for(j=1;j<=2*val1-1;j++) | ||
System.out.print(' '); | ||
|
||
if(val1!=0) | ||
System.out.print('*'); | ||
|
||
System.out.println(); | ||
row--; | ||
} | ||
} | ||
|
||
public static void main(String[] args) { | ||
// TODO Auto-generated method stub | ||
int n; | ||
Scanner s=new Scanner(System.in); | ||
n=s.nextInt(); | ||
hollowDiamond(n); | ||
|
||
|
||
} | ||
|
||
} | ||
|
||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,16 @@ | ||
class Box_unbox | ||
{ | ||
static Integer first=new Integer(12); | ||
static Integer second=3; | ||
static int third=second; | ||
static Integer result=0; | ||
public static void main(String args[]) | ||
{ | ||
result=third+second; | ||
System.out.println("result is: "+result); | ||
} | ||
|
||
|
||
} | ||
|
||
class Box_unbox | ||
{ | ||
static Integer first=new Integer(12); | ||
static Integer second=3; | ||
static int third=second; | ||
static Integer result=0; | ||
public static void main(String args[]) | ||
{ | ||
result=third+second; | ||
System.out.println("result is: "+result); | ||
} | ||
|
||
|
||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,37 @@ | ||
class Const_chain | ||
{ | ||
int no; | ||
String name; | ||
float age; | ||
Const_chain() | ||
{ | ||
no=0; | ||
name="default"; | ||
} | ||
|
||
Const_chain(int no,String name) | ||
{ | ||
this.no=no; | ||
this.name=name; | ||
} | ||
Const_chain(int no,String name,float age) | ||
{ | ||
this(no,name); | ||
this.age=age; | ||
} | ||
void show() | ||
{ | ||
System.out.println("no is: "+no+" name is: "+name+" age is: "+age); | ||
} | ||
|
||
public static void main(String... args) | ||
{ | ||
Const_chain c=new Const_chain(12,"harsh",18); | ||
c.show(); | ||
|
||
|
||
|
||
} | ||
} | ||
|
||
class Const_chain | ||
{ | ||
int no; | ||
String name; | ||
float age; | ||
Const_chain() | ||
{ | ||
no=0; | ||
name="default"; | ||
} | ||
|
||
Const_chain(int no,String name) | ||
{ | ||
this.no=no; | ||
this.name=name; | ||
} | ||
Const_chain(int no,String name,float age) | ||
{ | ||
this(no,name); | ||
this.age=age; | ||
} | ||
void show() | ||
{ | ||
System.out.println("no is: "+no+" name is: "+name+" age is: "+age); | ||
} | ||
|
||
public static void main(String... args) | ||
{ | ||
Const_chain c=new Const_chain(12,"harsh",18); | ||
c.show(); | ||
|
||
|
||
|
||
} | ||
} | ||
|
||
|
Oops, something went wrong.