The following code can achieve this:
#include <stdio.h>
#include <stdlib.h> /* For system() */
#define SIZE 28
int main()
{
char action;
unsigned int level;
char CommandString[SIZE];
printf ("\nTo Increase\\Decrease volume press 'i'/'d': ");
scanf ("%c", &action);
if (action!='i'&& action !='d')
{
printf ("\nInvalid Choice, please try again\n");
main();
}
printf ("\nEnter Voice Change Level: ");
scanf ("%u", &level);
if (action=='i')
{
printf ("\nIncreasing Voice level by: %u\n", level);
sprintf (CommandString, "amixer --quiet set Master %d+", level);
}
else
{
printf ("\nDecreasing Voice level by: %u\n", level);
sprintf (CommandString, "amixer --quiet set Master %d-", level);
}
system (CommandString);
return 0;
}