Advertisement
Guest User

Untitled

a guest
Sep 20th, 2019
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.89 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace Zad3
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             int exponent, broj;
  14.             int result = 1, i, j;
  15.  
  16.             Console.WriteLine("Unesite broj: ");
  17.             broj = Convert.ToInt32(Console.ReadLine());
  18.             Console.WriteLine("Unesite eksponent broja: ");
  19.             exponent = Convert.ToInt32(Console.ReadLine());
  20.  
  21.             int y = broj, z = exponent;
  22.  
  23.                 for ( i = 1; i < broj; i++)
  24.                 {
  25.                     for ( j = 1; j < exponent; j++)
  26.                     {
  27.                         y += z;
  28.                     }
  29.  
  30.                     z = y;
  31.                 }
  32.  
  33.             Console.WriteLine("Rezultat je " + y);
  34.  
  35.             Console.ReadKey();
  36.         }
  37.     }
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement