Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace sisarp
- {
- class Program
- {
- static void Main(string[] args)
- {
- /*Zadatak 0:
- Napravite program sljedeći navedene zahtjeve:
- a) neka korisnik sa tastature vrši unos cijelog broja x
- b) deklarišite niz N tipa int veličine x
- c) učitajte vrijednost niza sa tastature koristeći for petlju
- d) ispišite vrijednost niza koristeći foreach petlju. (Objašnjenje foreach petlje slijedi u nastavku.)*/
- int size;
- Console.WriteLine("unesite velicinu niza: ");
- size = int.Parse(Console.ReadLine());
- int [] n = new int[size];
- for (int i = 0; i < n.Length; i++)
- {
- Console.Write("Unesite " + (i+1) + " clan: ");
- n[i] = int.Parse(Console.ReadLine());
- }
- foreach (int i in n)
- Console.WriteLine(i);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement