Introduction to C Tutorial 7

Introduction to C Tutorial 7Short Description
Introduction to C Tutorial 7. Masha Nikolski CS Department, Technion; May 2006. #include . /* Declarations */. int plus(int a, int b); …

Website: www.cs.technion.ac.il | Filesize: 18kb

Content
Introduction to C Tutorial 7
Masha Nikolski CS Department, Technion; May 2006
#include
/* Declarations */
int plus(int a, int b);
int minus(int a, int b);
int times(int a, int b);
int power(int a, int b);
int main()
{
int k, n, i, j;
printf(”Please enter two integers: “);
if (scanf(”%d %d”, &n, &k) != 2) {
printf(”Error in input!
“);
return 1;
}
printf(”
Multiplication Table
“);
printf(”====================
“);
for (i = 1; i <= k; i++) {
for (j = 1; j <= n; j++)
printf("%d ", power(j, i));
printf("
");
}
return 0;
}
int plus(int a, int b)
{
int i;
if (b < 0)
return minus(a, -b);
for (i = 0; i < b; i++)
a++;
return a;
}
int minus(int a, int b)
{
int i;
if (b < 0)
return plus(a, -b);
for (i = 0; i < b; i++)
a--;
return a;
}
int times(int a, int b)
{
int i, res = 0, cnt = b;
if (b < 0)...

Get the file Download here

AddThis Social Bookmark Button
Related Books:
  • Tutorial Introduction to XML messaging
  • Introduction to MATLAB
  • AutoCAD Tutorial
  • Introduction - XML Tutorial
  • XML to Object Binding Tutorial
  • Using Borland C++ Tutorial Introduction Using the Borland C++ …
  • Adobe Acrobat Writer 5 Tutorial
  • Tutorial Microsoft Office 2003 Word Introduction Introduction …

  • Related Searches: , , , ,



    Comments

    Leave a Reply