Define a function and pass the array to the function

Assignment Help C/C++ Programming
Reference no: EM132095734

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 <stdio.h>

int main()
{
int x;

printf( "Please input two numbers to be multiplied: " );
scanf( "%d", &x );
printf( "The product of your two numbers is %d\n", 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 <stdio.h>
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;
}

Reference no: EM132095734

Questions Cloud

What is the maximum distance from the center of turntable : The coefficient of static friction between a small coin and the surface of a turntable is 0.30. The turntable rotates at 33.3 revolutions per minute.
What do you think of the suggestion to conduct a social : What do you think of the suggestion to conduct a social audit? As far as the issues raised in this case are concerned
How much of a medical expense deduction : Assuming that the Millers' adjusted gross income was $50,000, how much of a medical expense deduction may the Millers claim on their joint return
What is magnetism of an atom : Derive an expression for the dipole moment of the circulating charged particle. What is the concept of spin of an electron?
Define a function and pass the array to the function : Define a function and pass the array to the function. Inside the function multiply each value by 2 and print them.
What is the color of the bear : A bear ran from a zoo and climbed an electric pole of height 20 meters in the city. The rescue team hits the bear with a tranquilizer dart.
How the prices paid differed for each staff member : ITECH1100 Understanding the Digital Revolution - Describe the strategy you used to find appropriate prices for each scenario (approximately 150 words)
Create an unsorted array list with 100 random items in it : Create an unsorted array list with 100 random items in it and then perform a linear search on the array list looking for an item that is present in the list.
How accurately must the temperature be controlled : A silicon wafer of 100 mm diameter has 1 µm lines fabricated on it. The photomask is made of soda lime glass with a coefficient of thermal expansion.

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Create program that uses functions and reference parameters

Create program that uses functions and reference parameters, and asks user for the outside temperature.

  Write a program using vectors and iterators

Write a program using vectors and iterators that allows a user to maintain a personal list of DVD titles

  Write the code required to analyse and display the data

Calculate and store the average for each row and column. Determine and store the values for the Average Map.

  Write a webservices application

Write a webservices application that does a simple four function calculator

  Iimplement a client-server of the game

Iimplement a client-server version of the rock-paper-scissors-lizard-Spock game.

  Model-view-controller

Explain Model-View-Controller paradigm

  Design a nested program

How many levels of nesting are there in this design?

  Convert celsius temperatures to fahrenheit temperatures

Write a C++ program that converts Celsius Temperatures to Fahrenheit Temperatures.

  Evaluate and output the value in the given base

Write C program that will input two values from the user that are a Value and a Base with which you will evaluate and output the Value in the given Base.

  Design a base class shape with virtual functions

Design a base class shape with virtual functions

  Implementation of classes

Implementation of classes Chart and BarChart. Class barChart chould display a simple textual representation of the data

  Technical paper: memory management

Technical Paper: Memory Management, The intent of this paper is to provide you with an in depth knowledge of how memory is used in executing, your programs and its critical support for applications.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd