­
Skip to main content

C Program To Print Multiplication Table.

Method 1: The following program generates a multiplication table for a given integer to a given range.

#include <stdio.h>
int main() {
int n, range, i;

printf("Enter the value of n: ");
scanf("%d",&n);
printf("\nEnter the range: ");
scanf("%d",&range);

for(i=1;i<=range;++i) {
printf("%2d X %2d = %3d\n", n, i, n*i);
}
return 0;
}

Method 2: The following program generates multiplication tables for each integers from 1 to n (depends on your choice) to a range of 1 to 16.

#include <stdio.h>
int main () {

int i, j, n;
printf("Enter the value for n: ");
scanf("%d", &n);

for (i = 1; i <= n; i++) {
printf("\nMultiplicaton table for %d\n", i);

for (j = 1; j <= 16; j++) {
printf("%2d X %2d = %3d\n", i, j, i * j);
}
printf("\n");
}
return 0;
}

Popular posts from this blog

Screenshots from Windows 1.01

Windows 1.0 is a graphical personal computer operating environment developed by Microsoft, released on November 20, 1985, as the first version of the Microsoft Windows line. Version 1.01 , also released in 1985, was the first point-release after Windows 1.00.   Screenshots from Windows 1.01: ⇰ Desktop  First Run Empty Desktop Desktop With Applications ⇰  Office Applications Notepad Text Editor Calculator Calendar Clock Address Book ⇰  Multimedia Applications Media player, CD player, Volume level, and Sound: This GUI doesn’t have these features. ⇰  Networking Applications Terminal Phone Dialer: This GUI doesn’t have this feature. ⇰  Internet Applications Browser, and Mail: This GUI doesn’t have these features. ⇰  Accessibility Applications Keyboard Map:  This GUI doesn’t have this feature. ⇰  Settings Desktop themes,  Display,  S...

C++ Program To Implement Casino Number Guessing Game.

#include <iostream> #include <string> #include <cstdlib> #include <ctime> using namespace std; void drawLine(int n, char symbol); void rules(); int main() { string playerName; int amount; int bettingAmount; int guess; int dice; char choice; srand(time(0)); drawLine(70,'_'); cout << "\n\n\n\t\tCASINO GAME\n\n\n\n"; drawLine(70,'_'); cout << "\n\nEnter Your Name : "; getline(cin, playerName); cout << "\n\nEnter Deposit Amount To Play Game : $"; cin >> amount;

How to Create Tables in HTML?

HTML tables are still best known for being used and abused to lay out pages. There are a number of tags used in tables, and to fully get to grips with how they work is probably the most difficult area for HTML Beginners. Copy the following code into the body of your html document and then I will go through what each tag is doing: <table>     <tr>         <td>Row 1, cell 1</td>         <td>Row 1, cell 2</td>         <td>Row 1, cell 3</td>     </tr>     <tr>         <td>Row 2, cell 1</td>         <td>Row 2, cell 2</td>         <td>Row 2, cell 3</td>     </tr>     <tr>         <td>Row 3, cell 1</td>         <td>Row 3, cell...

The C Programming Language, 2nd Edition*

This book is meant to help the reader learn how to program in C. It is the definitive reference guide, now in a second edition. Although the first edition was written in 1978, it continues to be a worldwide best-seller. This second edition brings the classic original up to date to include the ANSI standard. For evolution of the planet earth and our modern understanding of biology, there was Darwin's Origin of the Species. For mathematics, there was Newton's Philosophiæ Naturalis Principia Mathematica. Well, for the internet, for Facebook, for LinkedIn, Twitter, Instgram, Snapchat, WhatsApp, Pornhub and even the odious website for Justin Bieber would never have existed without Kernigan and Ritchie (more affectionately known as K&R)'s classic, The C Programming Language. What language was TCP/IP written in? C. What language inspired both C++ and Java (and the abominable C#)? C. What language are most libraries on most operating systems written in if not assembler? C. ...