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

  Design and implement a cpp class which represents a book

Design and implement a C++ class which represents a Book, and use this class in a main program which reads in information for multiple books from a data file.

  Build a randomly generated simple substitution cipher

Design, implement and test classes in C++ Apply and implement ? overloaded? operators and functions Design and implement classes using inheritance

  Add a sentinel command to stop the loop

add a sentinel command to stop the loop. When the program is compiled, It'll ask the user to type in a palindrome. I want the user to type EXIT to end the loop.

  Iterative programming problem solving approaches

Write a recursive function void reverse ( ) that reverse a sentence

  Displays a table showing the price of silver and gold

Write a C++ program that displays a table showing the price of silver and gold. The table will have three columns. The first column will be labeled Ounces, the second labeled Silver, and the third labeled Gold.

  Is a void function a function that does not return a value?

Is a void function a function that does not return a value?

  Write definitions of the functions to overload the operators

Write the definitions of the functions to overload the operators defined in parts a to c and write  a  test  program  that  tests  various  operations  on  the class rectangleType.

  Solution to the naur text-processing problem

Design and implement a solution to the Naur text-processing problem using the language specified by your instructor. Execute it against test data and record the number of faults you find and the cause of each fault

  The purpose of the program is to prepare an accounting

the purpose of the program is to prepare an accounting database for e.g. a dorms kitchen to keep track of the

  Determines the access privillege of a derived class

The base class access specifier determines the access privillege of a derived class to its base class

  Write a program for a palindrome

Write a program for A palindrome is a string that reads the same from both the ends. Given a string S convert it to a palindrome by doing character replacement. Your task is to convert S to palindromes with minimum number of character replacements..

  Write a program that asks the user for the name of a file

Write a program that asks the user for the name of a file. The program should display the content of the file on the screen.

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