Answer to Question #303403 in C++ for Tariq

Question #303403

In main take two numbers as input num1 and num2. Main thread will create 2 more threads.

1. T1: Output sum of numbers from min(num1 , num2) to max(num1 , num2)

2. T2: Take a string as input and count num1 and num2 in it.


1
Expert's answer
2022-02-28T01:06:12-0500
#include <stdio.h>

#define min(x, y) ((x) < (y) ? (x) : (y))
#define max(x, y) ((x) > (y) ? (x) : (y))

int main() {
  int x, y;
  scanf("%d %d", &x, &y);
  printf("Min=%f", min(x, y));
  printf("Max=%f", max(x, y));
  return 0;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog