So I wrote this code...
#include "pch.h"
#include <iostream>
#include <time.h>
int random(int a, int b);
int a;
int b;
int main()
{
printf("Hello and welcome. You will now solve the following multiplication\n\n");
printf("What is: %d * %d ??", random(a, b));
}
int random(int a, int b)
{
srand(time(NULL));
a = rand() % 10;
b = rand() % 10;
return a*b;
}
My question is, how do I take the value of "a" and "b" from "int random" and place them inside my printf in "main"? I want random numbers to be generated that I can print on my screen via a function. Any help is gladly appreciated!