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 Zad4
- {
- class Program
- {
- static int Stepen(int broj, int stepen)
- {
- int c = 1;
- for (int i = 0; i < stepen; i++)
- {
- c*= broj;
- }
- return c;
- }
- static double Stepen(double broj, int stepen)
- {
- double k = 1;
- for (int i = 0; i < stepen; i++)
- {
- k *= broj;
- }
- return k;
- }
- static void Main(string[] args)
- {
- int br1;
- double br2;
- br1 = Stepen(5, 2);
- br2 = Stepen(2.5, 2);
- Console.WriteLine(br1);
- Console.WriteLine(br2);
- Console.ReadKey();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement