BZU PAGES: Find Presentations, Reports, Student's Assignments and Daily Discussion; Bahauddin Zakariya University Multan Right Header

HOME BZU Mail Box Online Games Radio and TV Cricket All Albums
Go Back   BZU PAGES: Find Presentations, Reports, Student's Assignments and Daily Discussion; Bahauddin Zakariya University Multan > Institute of Computing > Bachelor of Science in Computer Science > BsCS 6th Semester > Visual Programming


Reply
 
Thread Tools Search this Thread Rate Thread Display Modes
  #1  
Old 17-06-2011, 09:51 PM
thecool's Avatar
Senior Member


 
Join Date: Apr 2009
Location: Multan
Posts: 1,163
Contact Number: Push me a PM if you really need
Program / Discipline: Alumni
Class Roll Number: ---
thecool has a reputation beyond reputethecool has a reputation beyond reputethecool has a reputation beyond reputethecool has a reputation beyond reputethecool has a reputation beyond reputethecool has a reputation beyond reputethecool has a reputation beyond reputethecool has a reputation beyond reputethecool has a reputation beyond reputethecool has a reputation beyond reputethecool has a reputation beyond repute
Smartass c# program factorial of a number

How to write factorial of a number
Code:
using System;
using System.Collections.Generic;
using System.Text;

namespace factorial
{
class Program
{

static void Main(string[] args)
{
int i, fact = 1, n;
String no;
Console.WriteLine("Enter a number:");
no = Console.ReadLine();
n = Convert.ToInt32(no);
for (i = 1; i <= n; i++)
{
fact = fact * i;
}
Console.WriteLine("factorial is:" + fact);
Console.ReadLine();
}
}
}
using System;
using System.Collections.Generic;
using System.Text;

namespace factorial
{
class Program
{

static void Main(string[] args)
{
int i, fact = 1, n;
String no;
Console.WriteLine("Enter a number:");
no = Console.ReadLine();
n = Convert.ToInt32(no);
for (i = 1; i <= n; i++)
{
fact = fact * i;
}
Console.WriteLine("factorial is:" + fact);
Console.ReadLine();
}
}
}

Reply With Quote
Reply

Tags
factorial, number, program


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
A Program to find number in an array JuNaiDiQbaL Object Oriented Programming 0 06-05-2011 10:32 PM
Program to convert 2-digit octal number into binary number and print it bonfire Object Oriented Programming 0 09-03-2011 12:03 AM
Factorial Program (by Ahmad Mushtaq) !!Ahmad Mushtaq!! Visual Programming 2 21-12-2009 02:14 AM
Program to find the Minimum Number in an Array .BZU. Visual Programming 0 15-12-2009 10:57 PM
Program to find the Maximum Number in an Array (By Sheraz) .BZU. Visual Programming 0 15-12-2009 09:16 PM

Best view in Firefox
Almuslimeen.info | BZU Multan | Dedicated server hosting
Note: All trademarks and copyrights held by respective owners. We will take action against any copyright violation if it is proved to us.

All times are GMT +5. The time now is 03:19 PM.
Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.