Question: Please help!!! 1. Write a C program that inputs your first name, last name and U number as strings. Shown a menu with 3 different

Please help!!!

1. Write a C program that inputs your first name, last name and U number as strings. Shown a menu with 3 different options to either print your first name, your last name, or your U#. Use a function for each option.

2. Write a C program that creates an Array of integers dynamically (using malloc). You need to ask the user the size of the array. Define a function and pass the array to the function. Inside the function multiply each value by 2 and print them.

3. What is wrong or missing in this code to avoid errors or warnings?

#include

int main() { int x;

printf( "Please input two numbers to be multiplied: " ); scanf( "%d", &x ); printf( "The product of your two numbers is %d ", mult( x, y ) ); getchar(); } int mult (int a, int b) { return a * b; }

4. What is wrong or missing in this code to avoid errors or warnings? #include int main( ) { int p; int val[7] = { 11, 22, 33, 44, 55, 66, 77 } ;

p = val[0]; for ( int i = 0 ; i <= 6 ; i++ ) { printf("val[%d]: value is %d and address is %u", i, *p, p); p++; } return 0; }

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!