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
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started