- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to find and display the Multiplication Table in C#?
To display multiplication table, you need to set the numbers and format the output property. Let’s say you want to find the table of 4 from 1 to 10. For that, set a while loop first till 10.
while (a <= 10) { }
Now format the output to get the result as shown below. Here, n is 4 i.e. table of 4.
Console.WriteLine(" {0} x {1} = {2}
", n, a, n * a);
The above will give a formatted output −
4 x 1 = 4 4 x 2 = 8 4 x 3 = 12 . . .
The following is the complete example −
Example
using System; public class Demo { public static void Main() { int n = 4, a = 1; while (a <= 10) { Console.WriteLine(" {0} x {1} = {2}
", n, a, n * a); a++; } } }
- Related Articles
- How to Display the multiplication Table using Python?
- C++ Program to Generate Multiplication Table
- C++ Program to Print the Multiplication Table in Triangular Form
- C Program to represent a multiplication table.
- Kth Smallest Number in Multiplication Table in C++
- Print multiplication table of a given number in C
- C program to print multiplication table by using for Loop
- Java Program to Generate Multiplication Table
- Swift Program to Generate Multiplication Table
- Haskell Program to Generate Multiplication Table
- Kotlin Program to Generate Multiplication Table
- Java Program to Print the Multiplication Table in Triangular Form
- Haskell Program to Print the Multiplication Table in Triangular Form
- How to display a table body in HTML
- How to display the Engine of a MySQL table?

Advertisements