23 lines
743 B
C
23 lines
743 B
C
|
/*------------------------------------------------------------------------------
|
||
|
* File: for.c
|
||
|
* Function: Calculate the product of two even numbers
|
||
|
* Description: This C program calculates the product of two even numbers and outputs the results in the
|
||
|
form "2 times 8 is 16"
|
||
|
* Input: None
|
||
|
* Output: "2 times 8 is 16"
|
||
|
* Author(s): Noah Woodlee
|
||
|
* Date: Aug 20, 2021
|
||
|
*----------------------------------------------------------------------------*/
|
||
|
#include <msp430.h>
|
||
|
#include <stdio.h>
|
||
|
|
||
|
int main(){
|
||
|
int i, p=0;
|
||
|
int second = 6;
|
||
|
int first = 4;
|
||
|
for(i=0;i<second; i++) {
|
||
|
p=p+first;
|
||
|
}
|
||
|
printf ("%d times %d is %d\n", first,second,p);
|
||
|
}
|