Cihan Zengin
Cihan Zengin

Reputation: 23

Xcode5 lost connection error with C

when i build & run my code i get this error

one exited unexpectedly lost connection

Program ended with exit code; -1

any ideas?

#include <stdio.h>

int main()
{
    int hour;
    float price, total_price;
    char first_letter;
    printf("Type first letter of worker name> ");
    scanf("%c",&first_letter);
    printf("Type work hours> ");
    scanf("%d",&hour);
    printf("Type price for per hour> ");
    scanf("%f",&price);
    total_price = hour * price;
    printf("%c worker will get money per hour: %f\n",first_letter,total_price);
    return 0;
}

Upvotes: 1

Views: 66

Answers (1)

reversegremlin
reversegremlin

Reputation: 38

I was having the exact same problem. Use shift+Enter, without the shift it is a Return.

Upvotes: 1

Related Questions