Notes
Notes - notes.io |
int arr2[]=new int [arr1.length]
for (int i=0; i<=arr1.length;i++){
arr2[i]=arr1[i];
}
for (int i.....)
system.out.println (arr2[i]);
}
//ushtrim
package megi;
public class arrayelda {
public static void main (String[]args) {
int i;
int arr1[]= new int []{2,3,6,4,6};
int arr2[]= new int[arr1.length];
for (i=0;i<arr1.length;i++) {
arr2[i]=arr1[i];
}
for (i=0;i<arr1.length;i++) {
System.out.println (arr2[i]);
}
}
}
package megi;
import java.util.Scanner;
public class arrayelda {
public static void main (String[]args) {
Scanner sc=new Scanner (System.in);
int i;
int arr1[]= new int []{2,3,6,4,6};
int arr2[]= new int[arr1.length];
System.out.println ("Vendosni pese numra");
for (i=0;i<arr1.length;i++) {
arr1[i]=sc.nextInt();
arr2[i]=arr1[i];
}
for (i=0;i<arr1.length;i++) {
System.out.println (arr2[i]);
}
}
}
//dsh notat e studenteve dhe mesataren e tyre me kusht for dhe array
kur kemi cift 6%2==0
kur kemi tek 6%2!==0
ushtrim///
package megi;
import java.util.Scanner;
public class cift_tek {
public static void main(String[] args) {
Scanner sc = new Scanner (System.in);
int i;
int n;
int s=0;
System.out.println ("Vendos numrin sa elemente do te jene:");
n=sc.nextInt();
int a[]=new int[n];
System.out.println ("Vendosni elementet:");
for (i=0;i<n;i++) {
a[i]=sc.nextInt();
}
for (i=0;i<n;i++) {
if (a[i]%2!=0) {
System.out.println ("Numrat tek jane:"+a[i]);
}
else {
System.out.println ("Numrat jane cift"+a[i]);
}
}
}
}
ush//
package megi;
import java.util.Scanner;
public class max_min {
public static void main(String[] args) {
Scanner sc = new Scanner (System.in);
int i;
int[] a = new int[10];
for (i=0;i<a.length;i++) {
System.out.println ("Vendos nje numer a["+i+"]");
a[i]=sc.nextInt();
}
int max = a[0];
int min = a[0];
for (i=0;i<a.length;i++) {
if (a[i]>max)
max=a[i];
if (a[i]<min)
min=a[i];
}
System.out.println ("Me i madhi eshte: "+max+"dhe me i vogli: "+min);
}
}
dsh// gjeni nr qe mungon. said.al/java
ushtrim klase//
package megi;
import java.util.Scanner;
public class mesatarja {
static double mesatarja (int a[],int n)
{
int shuma=0;
for (int i=0;i<n;i++)
shuma=shuma+a[i];
return (double)shuma/n;
}
public static void main(String[] args) {
int arr[]= {10,2,3,4,5,6,7,8,9};
int n=arr.length;
System.out.println (mesatarja(arr,n));
}
}
linku i videove : https://www.youtube.com/playlist?list=PLRaGH10KJ8Iz6GYRjCNRT6ZeM0t0xn6XO
|
Notes.io is a web-based application for taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000 notes created and continuing...
With notes.io;
- * You can take a note from anywhere and any device with internet connection.
- * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
- * You can quickly share your contents without website, blog and e-mail.
- * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
- * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.
Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.
Easy: Notes.io doesn’t require installation. Just write and share note!
Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )
Free: Notes.io works for 12 years and has been free since the day it was started.
You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;
Email: [email protected]
Twitter: http://twitter.com/notesio
Instagram: http://instagram.com/notes.io
Facebook: http://facebook.com/notesio
Regards;
Notes.io Team