Great Deal! Get Instant $10 FREE in Account on First Order + 10% Cashback on Every Order Order Now

ECE347_HW10_C_language ECE347 - Extra HW on C language 1. Write a C language main function that multiplies two integers a and b, with the result being stored in a long integer. Use some arbitrary...

1 answer below »
ECE347_HW10_C_language
ECE347 - Extra HW on C language

1. Write a C language main function that multiplies two integers a and b, with the result being
stored in a long integer. Use some a
itrary numbers for testing.









2. Re-write the above problem such that the main function initializes a and b, then calls a
function that uses a and b as input parameters, performs the multiplication, and returns the long
esult.












3. What is the Code Wa
ior name used to identify the data direction register, bit 6, on port P?




4. Write a simple C language function that initializes the GPIO bits on port B, such that bit 7 is
an input with pullup enabled, bit 6 is an output, and no other bits are manipulated.
Answered Same Day Apr 20, 2021

Solution

Ria answered on Apr 24 2021
134 Votes
solution/ece347hw10clanguage-solution.docx
ECE347 - Extra HW on C language
1. Write a C language main function that multiplies two integers a and b, with the result being stored in a long integer. Use some a
itrary numbers for testing.
#include int main()
{
    int a,b;        
two integer numbers
    long int c;        
two long integer numbers
    
get two numbers from use
    printf("Enter two integer numbers:\n");
    scanf("%d%d", &a, &b);
    
multiply two integers and store result into a long intege
    c = a * b;
    
show result
    printf("The result is: %li\n", c);
    return 0;
}
2. Rewrite the above problem such that the main function initializes a and b, then calls a function that uses a and b as input parameters, performs the multiplication, and returns the long result.
#include long int multiplication(int a, int b)
{
    long int c;        
two long integer numbers
    c = a * b;        
multiply two integers
    return c;        
returns long intege
}
int main()
{
    int a,b;        
two integer numbers
    
get two numbers from use
    printf("Enter two integer numbers:\n");
    scanf("%d%d", &a, &b);
    
show result
    printf("The result is: %li\n", multiplication(a, b));
    return 0;
}
3. What is the Code Wa
ior name used to identify the data direction register, bit 6, on port P?
The...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here