【发布时间】:2019-01-02 12:44:19
【问题描述】:
我在 Dev C++ 中运行此代码时遇到问题。
#include<stdio.h>
#include<conio.h>
main()
{
/*
Write a program to calculate overtime pay of 10 employees.
Overtime is paid at the rate of Rs. 12.00 per hour for every hour worked above 40 hours.
Assume that employees do not work for fractional part of an hour.
*/
int sal,pay,re;
for(int i=0;i<=10;i++)
{
printf("Write down your over time(in hours): ");
scanf("%d",&sal);
re = sal - 40;
pay = re * 12;
printf("Your pay is %d ",pay);
}
}
我收到以下错误
[错误] 'for' 循环初始声明只允许在 C99 或 C11 模式下使用
【问题讨论】: