예제 #1
0
int main(int argc, const char * argv[]) {
    
    congratulateStudent("Kate", "Cocoa", 5);
    congratulateStudent("Bo", "Objective-C", 2);
    congratulateStudent("Mike", "Python", 5);
    congratulateStudent("Liz", "iOS", 5);
    
    return 0;
}
int main(int argc, const char * argv[]) {
    congratulateStudent("Kate", "Cocoa", 5);
    sleep(2);
    congratulateStudent("Bo", "Objective-C", 2);
    sleep(2);
    congratulateStudent("Elena", "JS", 1);
    sleep(2);

    return 0;
}
예제 #3
0
파일: main.c 프로젝트: higginator/Developer
int main(int argc, const char * argv[])
{
    congratulateStudent("Ryan", "iPhone Programming Introduction", 5);
    sleep(2);
    congratulateStudent("Iskander", "Android Programming Introduction", 30);
    sleep(2);
    congratulateStudent("Scotty", "Chef School", 300);
    
    return 0;
}
예제 #4
0
int main(int argc, const char * argv[])
{
    congratulateStudent("Mark", "Cocoa", 5);
    sleep(2);
    congratulateStudent("Bio", "Objective-C", 2);
    sleep(2);
    congratulateStudent("Mike", "Python", 5);
    sleep(2);
    congratulateStudent("Ted", "iOS", 5);
   
    return 0;
}
예제 #5
0
int  main(int argc, const char * argv[]) {
    float weight;
    float cookingTime;
    
    weight = 14.2;
    cookingTime = 15.0 + 15.0 * weight;
    
    printf("Cook it for %f minutes.\n", cookingTime);
    
    if(cookingTime < 0){
        printf("true\n");
    }
    else{
        printf("false\n");
    }
    
    /*Calling*/
    congratulateStudent("Abdou", "English", 4);
    sleep(2);
    congratulateStudent("Hichem", "Java", 5);
    congratulateStudent("Walid", "World", 2);
    congratulateStudent("Mimi", "Cook", 1);
    
    
    
    int x =255;
    unsigned long y = 55;
    
    printf("y is %lu.\n",y);
    
    printf("x is %d.\n",x);
    printf("x in octal is %o.\n",x);
    printf("x in hexadecimal is %x.\n",x);
    
    const char *name = readline(NULL);
    printf("%s is cool!\n", name);
    

    //Adresses
    printf("weight is stored in %p", &weight);
    
    //Structs - static
    struct Person{
        float height;
        int weight;
    };
    
       struct Person mikey;
    
    mikey.height = 10;
    mikey.weight = 12;
    
    printf("Mickey height is %f\n",mikey.height);
    
    
    person *per = (person *)malloc(sizeof(person));
    
    per->height = 12;
    per->weight = 20;
    
    float weightgetting = getWeight(per);
    
    printf("Height %f \n",per->height);
    printf("Weight %f \n",weightgetting);
    
    free(per);
    
    per = NULL;
    
    return  0;
}