Write a function int solution(int N, int M, char CH) that accepts two integers (N and M) and one character CH. The function should return the product of two integers if a character (CH) is 'p' otherwise return thei sum.

COMPREHENSIVE MICROSOFT OFFICE 365 EXCE
1st Edition
ISBN:9780357392676
Author:FREUND, Steven
Publisher:FREUND, Steven
Chapter3: Working With Large Worksheets, Charting, And What-if Analysis
Section: Chapter Questions
Problem 2.2EYK
icon
Related questions
Question
Write a function
int solution(int N, int M, char CH)
that accepts two integers (N and M) and
one character CH. The function should
return the product of two integers if a
character (CH) is 'p' otherwise return their
sum.
Transcribed Image Text:Write a function int solution(int N, int M, char CH) that accepts two integers (N and M) and one character CH. The function should return the product of two integers if a character (CH) is 'p' otherwise return their sum.
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 2 images

Blurred answer
Knowledge Booster
Datatypes
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
COMPREHENSIVE MICROSOFT OFFICE 365 EXCE
COMPREHENSIVE MICROSOFT OFFICE 365 EXCE
Computer Science
ISBN:
9780357392676
Author:
FREUND, Steven
Publisher:
CENGAGE L