When I build and run it in Code::Blocks it works fine, and pauses after execution. When it comes to debugging the code using "debugger" it exits the console when the last printf statement should show... What am I doing wrong? :? The Code I am working with is below:
#include <stdio.h>
#include <stdlib.h>
/******************************
* Wage Calculator
* Ashley M Begley
*
******************************/
int s, a;
float b;
int main()
{
printf("COPYRIGHT INFORMATION\n-------------------\nThis program was designed by Ashley M Begley, who owns all copyright deeds to this program!\n\n");
printf("\n\n---------------------------------------------\n\nWelcome to 'Wage Pro Estimator'!");
printf("\n\nThis program is really simple to use. Just answer the questions below and my big brain will work it all out for you ;)");
printf("\n\n1) What is your hourly pay rate in GBS?: ");
scanf("%f", &b);
printf("2) How many shifts have you done this pay period period?: ");
scanf("%d", &a);
float wage[a];
float avg = 0;
for (s = 0 ; s < a; s++)
{
printf("How many hours did you work in shift %d? : ", s+1);
scanf(" %f", &wage[s]);
avg += wage[s];
}
avg *=b;
printf("\nYour estimated wage is %.2f GBS", avg);
return 0;
}