Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

The Database Factory Active Database For Enterprise Computing

Authors: Schur, Stephen

1st Edition

0471558443, 9780471558446

Students also viewed these Databases questions