d2jsp
Log InRegister
d2jsp Forums > Off-Topic > Computers & IT > Programming & Development > Compiled First Code
Add Reply New Topic New Poll
Member
Posts: 235
Joined: Sep 15 2017
Gold: 206.00
Sep 14 2020 09:19am
Hey - I ran this simple code in Code::Blocks

#include <stdio.h>
int main ()
{
printf("I am alive! Beware.\n");
getchar();
return 0;}

I got the instructions here - and I may try to go through the rest of the parts of the Intro C tutorial over the next few months.
I tried using Visual Studio Code back in 2019 but never figured it out. Happy to have compiled my first code and run it.
I'm working at a call centre right now & getting 4500 in grants to take some public policy courses part time.. But id like to learn C on the side.

Ok thanks.

https://www.docdroid.net/ZQtDD2V/intro-to-c-basic-features-pdf

Member
Posts: 235
Joined: Sep 15 2017
Gold: 206.00
Oct 2 2020 11:36am
Hey - here's an If statement in C I wrote in Code::Blocks - it replies to how much tv you watch.

#include <stdio.h>
int main()
{
int hours; /*hours variable*/
printf( "please enter the hours you watch tv");
scanf( "%d", &hours);
if (hours < 10 ){
printf ("You watch alot of tv\n" );
}
else if ( hours == 10) {
printf( "You are maxed out\n");
}
else {
printf ( "Your a loser\n");
}
return 0;
}
Go Back To Programming & Development Topic List
Add Reply New Topic New Poll