Computer Tricks
Home
Tips And Tricks
Internet
Facebook
Games
Downloads
Software
Chrome
Mobile
Earn Online
Privacy policy
About
Showing posts with label
C# Programming
.
Show all posts
Showing posts with label
C# Programming
.
Show all posts
Friday, 17 March 2017
12:24
Write a Program to Display Factors of a Number.
Article Website
C# Programming
No comments
Write a Program to Display Factors of a Number. For Example:
Output :
Enter a positive integer: 60
Factors of 60 are: 1 2 3 4 5 6 12 15 20 30 60
int n;
Console.Write("Enter a Positive Number ");
n = Convert.ToInt32(Console.ReadLine());
Console.Write("Factors of {0} are :",n);
for (int i = 1; i < n; ++i)
{
if (n % i==0)
{
Console.Write(" "+i);
}
}
Read More
Older Posts
Subscribe to:
Comments (Atom)
Raja Muhammad Ali
Digital Marketing Agency
Labels
Android
C# Programming
Chrome
Computer
earn Online
Ecommerce Website
Entertainment
Facebook
Games
internet
Internet & Marketing
Mobiles
mozilla
Security
softwares
Copyright @ 2024
Computer Tricks
.
Designed by
Templateism
|
MyBloggerLab