Just started coding and got stuck trying to do math. The code should perform an addition after user input, but I only keep getting random results like -952492524
when running the code on terminal. How is the correct way to fix this?
This is the code:
#include <stdio.h>
main()
{
int iquantity, iprice;
int iresult = iquantity + iprice;
scanf("%d", &iquantity);
scanf("%d", &iprice);
printf("%d", &iresult);
}