P
Profetas
I have to do a program that determine the biggest
number in the month
I have to use enum
so I was wondering can I declare an array of a type
like
#include <stdio.h>
int main()
{
int h_rain_fall, n_months, i;
enum months {jan=23, feb=19, apr=27, mar=38, may=33, jun=24, jul=20,
aug=18, sep=26, oct=30, nov=26, dec=22};
string a_months[jan,feb,apr,mar,may,jun,jul,aug,sep,oct,nov,dec];
n_months = 12;
i = 0;
for(i=n_months; i!=0 ; i--) {
printf("teste %d", a_months);
if (a_months > h_rain_fall)
{
h_rain_fall = a_months;
}
else
{
//skip
}
}
printf("The highst rain fall is %d",h_rain_fall);
return(0);
}
Thanks Profetas
number in the month
I have to use enum
so I was wondering can I declare an array of a type
like
#include <stdio.h>
int main()
{
int h_rain_fall, n_months, i;
enum months {jan=23, feb=19, apr=27, mar=38, may=33, jun=24, jul=20,
aug=18, sep=26, oct=30, nov=26, dec=22};
string a_months[jan,feb,apr,mar,may,jun,jul,aug,sep,oct,nov,dec];
n_months = 12;
i = 0;
for(i=n_months; i!=0 ; i--) {
printf("teste %d", a_months);
if (a_months > h_rain_fall)
{
h_rain_fall = a_months;
}
else
{
//skip
}
}
printf("The highst rain fall is %d",h_rain_fall);
return(0);
}
Thanks Profetas