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.
#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;
}
Comments
Leave a comment