Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
U

User 1959283

@User 1959283
About
Posts
1
Topics
0
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Math troubles
    U User 1959283

    using System; namespace fact { /// /// Summary description for Class1. /// class Class1 { /// /// The main entry point for the application. /// [STAThread] static void Main(string[] args) { //calculate n! Console.WriteLine("Enter the value of N"); int nFact = 1; int nComputeTo =int.Parse(Console.ReadLine()); int nCurDig = 1; for (nCurDig=1;nCurDig <= nComputeTo; nCurDig++) nFact *= nCurDig; int Nfactorial=nFact; Console.WriteLine("n! = "+nFact+"\n"); //calculate (n-k) ! Console.WriteLine("Enter the value of K"); int nFact1 = 1; int k=int.Parse(Console.ReadLine()); int nComputeTo1=nComputeTo-k;//n-k int nCurDig1 = 1; for (nCurDig1=1;nCurDig1 <= nComputeTo1; nCurDig1++) nFact1 *= nCurDig1; int NminusKfactorial=nFact1; try { int npk=Nfactorial/NminusKfactorial;//n_p_k=n!/(n-k)! Console.WriteLine("(n-k)! = "+nFact1+"\n"); Console.WriteLine(" n_p_k="+npk); Console.ReadLine(); } catch(DivideByZeroException ex) { Console.WriteLine(ex.Message); } catch(OverflowException ex) { Console.WriteLine(ex.Message); } catch(Exception e) { Console.WriteLine(e.Message); } } } }

    C# csharp
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups