fatal error #1035: Can't find include file "stdafx.h"

703 Views Asked by At

I've started using Pelles C compiler as Microsoft Visual Studio won't work on my laptop. So, whenever I debug the following program, I get the "fatal error #1035: Can't find include file "stdafx.h". What's wrong here and what should I do to fix it?

#include "stdafx.h"
#include "stdio.h"
#include "conio.h"
#include "math.h"

int_tmain()

{
float mu=0, var=0, std;
float x[20]={84, 63, 21, 78, 82, 19, 83, 47, 23, 78, 54, 60, 91, 23, 29, 48, 37, 26};
int i, n=20;

for(i=0;i<n;i++)
    mu+=x[i];

    mu/=n;

for(i=0;i<n;i++)
    var+=(x[i]-mu)*(x[i]-mu)

    var/=n;
    std=sqrt(var);

printf("\nAverage=%f\t Variance=%f\t STDEV=%f\n", mu, var, std);

getch();
return 0;
1

There are 1 best solutions below

2
On

try this

#include <stdio.h>
#include <conio.h>
#include <math.h>

int main(){
    float mu=0, var=0, std;
    float x[20]={84, 63, 21, 78, 82, 19, 83, 47, 23, 78, 54, 60, 91, 23, 29, 48, 37, 26};
    int i, n=20;// n=18 ?

    for(i=0;i<n;i++)
        mu+=x[i];

    mu/=n;

    for(i=0;i<n;i++)
        var+=(x[i]-mu)*(x[i]-mu);//<- you have forgotten the semicolon.

    var/=n;
    std=sqrt(var);

    printf("\nAverage=%f\t Variance=%f\t STDEV=%f\n", mu, var, std);

    getch();
    return 0;
}