Write a program to calculate the timetable, C/C++ Programming

Assignment Help:

Write a program to calculate the timetable for numbers 1 -> 10 and display them as follows. Your solution should use for do loops
    
#include stdio.h
void main()

  char prompt;
  int x;
/* The maximum answer is 100 i.e 3 characters. Therefore we will use a format sepecification of %3d and 2 spaces i.e %5d */

printf("\t\t\t Timestable \n\r");

printf("\t\t\t __________ \n\n\r");

printf("          1     2     3     4     5     6     7     8     9    10\n\r");

printf("\n\r");

for (x=1;x <=10;x++)
  {
printf("%5d%6d%6d%6d%6d%6d%6d%6d%6d%6d%6d  \n\r",
  x,x,2*x,3*x,4*x,5*x,6*x,7*x,8*x,9*x,10*x);
  }   
printf("Press any key to exit \n\r");
scanf("\n%c",&prompt); 
}


Related Discussions:- Write a program to calculate the timetable

Compiler design-limit the methods, Problem : Compiler Design - Limit the me...

Problem : Compiler Design - Limit the methods Rahul is a newbie to the programming and while learning the programming language he came to know the following rules: ·

Change to palindrome, A palindrome is a string that reads the same from the...

A palindrome is a string that reads the same from the both the ends. Given a string S convert it to a palindrome by doing character replacement. Your takes is to convert S to palin

Explain polymorphism, Polymorphism C++ supports this idea - that differ...

Polymorphism C++ supports this idea - that different objects do "the right thing "- by function polymorphism and class polymorphism. Poly means many, while morph means form.

Explain the macros, Explain the Macros? Preprocessor' is a translation ...

Explain the Macros? Preprocessor' is a translation stage that is applied to your source code before the compiler proper gets its hands on it. Usually the preprocessor performs

C program to demonstrate call by reference, C program to demonstrate call b...

C program to demonstrate call by reference: void disp(int *,int*,int*,int*); void main() {                 int a=2,b=3, sum,mul;                 printf("Enter 1st n

Area under curve, a program to find the area under curve y=f(x) between x=a...

a program to find the area under curve y=f(x) between x=a and x=b,integrate y=f(x) between the limits of a and b.

C++ Program Please see where i do mistake, #include #include #include ...

#include #include #include #include #include class Employee { private: char *Name; //Set them as pointers... int IdNumber; char *Department; char *Position; public: voi

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd