Creates an array of integers dynamically

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

Please help ASAP!!! Thank you so much!

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: EM132095869

Questions Cloud

Write a main program to call the function : Write a main program to call the function using an integer of your choice and print the contents.
What is the ending inventory using the average cost method : Sales for the year totaled 270 units, leaving 10 units on hand at the end of the year. What is the ending inventory using the average cost method (rounded)
What is the saving in the average time to retrieve a webpage : The time for A to obtain the remaining web object after the reception of the HTML file, assuming all the web objects are cached at the proxy.
Prepare journal entries for first interest payment on june : Woodwick Company issues 6%, five-year bonds, on December 31, 2014, Prepare journal entries for first interest payment on June
Creates an array of integers dynamically : Write a C program that creates an Array of integers dynamically (using malloc). You need to ask the user the size of the array.
Defining characteristics of companies : Fortune magazine and hay group found that a clear, stable strategy is one of the defining characteristics of companies on the list
Simulate the transmission and reception of a text message : The purpose of this assignment is to simulate the transmission and reception of a text message over a noisy communications channel.
Representations of business data flow and processes : Assignment - Literature Bonanza - Select appropriate IT solutions for business functions - Apply business information software for data visualization
Prepare january journal entry to record the bond issuance : Legacy issues $710,000 of 8.0%, four year bonds dated January 1, 2015, Prepare the January 1, 2015, journal entry to record the bond's issuance

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Write the two redox half-reactions

How would I write the two redox half-reactions for these: Ag/Ag+| | H+/H2 Cu/Cu2+| | H+/H2 H2/H+| | Zn2+/Zn

  Need a program that is in c language that completes task

The machine is to be located at the entrance of main gate. This will ensure that a car can park only after the payment is made.

  Assignment 1 boxing amoebadevelop a two dimensional

assignment 1 boxing amoebadevelop a two dimensional interactive game with the following features1.use opengl any

  Explain the data types used in c language

What is data type? Explain the data types used in C language.Write a program and draw a flowchart to print 1 to 100 all natural numbers.

  Wap that takes as input the distance of the commute in miles

An automobile is used for commuting purposes. Write a program that takes as input the distance of the commute in miles, the automobile's fuel consumption rate.

  Allow single play a simple two dice game of chance against

Write a program that allows a single Player (the user) to play a simple two dice game of chance against

  Discuss the concept of the if-else statement

Suppose savings and expenses are variables of type double that have been given values. Write an if-else statement that outputs the word "Solvent".

  Fill in the blanks related to pointer

A pointer variable contains as its value the_________ of another variable.

  Double-subscripted array to solve the following problem

A company has four salespeople (1 to 4) who sell five different products (1 to 5). Each salesperson passes in slips for each different type of product sold.

  Write a stack class using two stl lists

CSC 2200 - Write a stack class using two STL lists. Naturally, a single STL list is more than enough to represent a stack and Object at the top of the stack

  Write a program that asks you to enter your height in inches

Write a program that asks you to enter your height in inches and then displays your height in centimeters. Or, if you prefer, ask for the height in centimeters and convert that to inches.

  Figure out what is the largest power of 2 that is less than

Ask the user for a number between 3 and 100 (inclusive). USING LOOPS, figure out what is the largest power of 2 that is less than or equal to the number entered. For example, if the user entered 6, answer would be 4. If the user entered 100, the answ..

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