odnz


Joined 1 year ago
Homeworks submitted:
Homework comments:
3
0

About Me

just a guy hopped up on caffeine at 2 am on a friday.

Classes

Programming in C

Class status: Established
Role: Student
. 6% complete

Submitted Assignments

Programming in C: Lesson 1, HW 3

modified the for loop example.

#include "stdio.h"

int main()
{
    int fahr;

    for (fahr = 300; fahr >= 0; fahr = fahr - 20)
        {
            printf("%3d %6.1f\n", fahr, (5.0/9.0)*(fahr-32));
        }

    return(0);
}


300  148.9
280  137.8
260  126.7
240  115.6
220  104.4
200   93.3
180   82.2
160   71.1
140   60.0
120   48.9
100   37.8
 80   26.7
 60   15.6
 40    4.4
 20   -6.7
  0  -17.8

Process returned 0 (0x0)   execution time : 0.018 s
Press any key to continue.

odnz 1 year ago
Programming in C: Lesson 1, HW 2
#include "stdio.h"

int main()
{
    //start F->C
    printf("Fahrenheit - to - Celsius\n\n");

    float fahr, cel;
    float min=0 , max=200, step=20;

    fahr = min;

    while (fahr <= max)
    {
        cel = (5.0/9.0) * (fahr-32.0);

    printf("%3.f\t\t%6.1f\n", fahr, cel);

    fahr = fahr + step;
    }
    //start C->F
    printf("\n\nCelsius - to - Fahrenheit \n\n");


    min=0 , max=200, step=20;

    cel = min;

    while (cel <= max)
    {
        fahr = cel/(5.0/ 9.0)+32.0 ;

    printf("%3.f\t\t%6.1f\n", cel, fahr);

    cel = cel + step;
    }

    return(0);

odnz 1 year ago
Programming in C: Lesson 1, HW 1

..helloworld.c|5|warning: unknown escape sequence 'o'|

#include "stdio.h"

int main()
{
    printf("Hello, World\o");

    return(0);
}

odnz 1 year ago