Produce the correct code

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

The following code fragment produces the correct result sometimes and sometimes it does not. Explain what is happening and why.

#include <stdio.h>
#define max(a,b) ((a) > (b) ? (a): (b))
void main(void)
{
int i = 0;
int j = 0;
int a = 3;
int b = 4;
int c = 6;
int d = 5;
i = max(a,b);
j = max(c,d);
printf("i = %i, j = %in",i,j);
i = max(a++, b++);
printf("a = %i, b = %in",a,b);
j = max(c++,d++);
printf("c = %i, d=%in",c,d);
return;
}

Reference no: EM13938920

Questions Cloud

Program that asks the user to enter a number from 1 to 50 : Print the statement "Programming is fun" the number of times entered by the user using a for loop.
Importance to consumer behaviour and marketing : Discuss the concept of perceived value and its importance to consumer behaviour and marketing. Discuss the theory and then give practical examples of how customers perceive various brands and how this impacts on their behaviour.
Calculate all the relevant overhead variances : Calculate all the relevant overhead variances for the department, and write a memo that describes what each one means.
Identify the blood vessel that is probably involved : Explain symptoms a through c. Where is the lesion (area of CNS and side)? Identify the blood vessel that is probably involved.
Produce the correct code : The following code fragment produces the correct result sometimes and sometimes it does not. Explain what is happening and why.
Approach to investing in foreign markets : Critically discuss the methods and theories that might be used by a company to help it decide its approach to investing in foreign markets.
Explain which company appears to be the most liquid : Below are three ratios calculated for Huey, Louie, and Dewey Companies for 2008 and 2009. Explain which company appears to be the most liquid.
What medical test best confirm reasoning for patient symptom : What would you consider is a major medical complication for this patient other than the newly diagnosed stroke? Please consider the appropriate classification and type of condition for this patient's pulmonary diagnosis. Provide rationale for your..
Characteristics affecting consumer behaviour : Writing Task In the assessment block you will find the task "Portfolio task 2 - Consumer behaviour". Provide an advertisement for a product you regularly use or consume - it can be a print ad from a newspaper or magazine or it can be a TV ad if yo..

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Database for a programming support environment

Design the database for a programming support environment. In this environment programmers produce programs, which are written in given programming languages.

  In this program you will implement a simple reverse polish

in this program you will implement a simple reverse polish notation rpn calculator. rpn is a notation in which

  Program that reads a student''s name together with score

A value-returning function, calculateGrade, to determine and return each student's grade. (This function does not output the grade. That task must be done in the function main.)

  Create your own function that accepts one input parameter

Create your own function that accepts one input parameter and returns a float number. You decide the theme. You should provide the pseudocode and an example call. Be sure to provide an overview of what your function is doing.

  Determine the reynolds number of flow in a rectangular

determine the reynolds number of flow in a rectangular channel 2m deep and 4m wide if the water level is 60 and running

  Write a statement to call the function

Write an if statement that will assign 7 to p if the variable q is outside the range 100 through 1000. (Use single spaces between operators, operands and statements)

  What is the output of the following function call after main

What is the output of the following function call, given the function shown after main?

  Write an array-returning method

Write an array-returning method that takes a two-dimensional array of chars as a parameter and returns a single-dimensional array of Strings as follows:

  Write the definition of the function template

Add the operation queueCount to the class queueType (the array implementation of queues), which returns the number of elements in the queue

  Multiply a set of complex numbers

Write a C program to multiply a set of complex numbers stored in an array (that has been dynamically allocated). Specifically, first prompt the user to enter how many complex numbers need to be multiplied, dynamically create an array to store the ..

  Use a for loop to generate 100 random numbers.

Use a For Loop to generate 100 random numbers. Determine the most current maximum and minimum number as the random numbers are being generated. This is referred tp as a "running" maximum and minimum. Display the running maximum and minimum values as ..

  Define an auxiliary procedure

How to use do to define (minimum lst) which returns the minimum of a list of numbers. You may want to define an auxiliary procedure (smaller x y), using if, which returns the smaller of the two numbers.

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