First C program made by me :)

c, c++, php, html, sql ..etc discussion. also includes codes and source codes.
Post Reply
User avatar
Sethioz
Admin
Admin
Posts: 4762
Joined: Fri Jul 27, 2007 5:11 pm
Custom: Gaming YT > https://youtube.com/SethiozEntertainment
Game Hacking YT > https://youtube.com/sethioz
Game Hacks Store > https://sethioz.com/shopz
Location: unknown
Contact:

First C program made by me :)

Post by Sethioz »

tought that ill post it lol.
its the first program i actually wrote in C. It works thru cmd.
Note that ive never learned C before and it took me only 1-2 hours to write it totally on my own.
C is quite easy actually :)
was thinking to make calculator, but its kind a waste of time. Its very easy to make tho. Kind a got tired of reading C tutorials so blah...but ill make simple calculator next...or something similiar.
:iiN:

edit:
oh yeah .. heres the source code too:

Code: Select all

#include <stdio.h>

int main()
{
  int number;

  printf( "Enter a number to check if its smaller or bigger than 303: " );
  scanf( "%d", &number );
  if ( 303 < number )
    printf( "number is bigger than 303" );
    
  if ( 303 > number )
    printf( "number is smaller than 303" );  
    
  if ( 303 == number )
    printf( "number is equal to 303" );

  getchar();
  printf( "\nPress enter to continue..." );
  getchar();
  printf( "\nEnter a number to check if its equal to 303: " );
  scanf( "%d", &number );
  if ( 303 == number )
    printf( "number is equal to 303" );
    
  else {
    printf( "number is not equal to 303" );
  }
  getchar();
  printf( "\nPress enter to quit..." );
  getchar();
}
Attachments
303.rar
(4.51 KiB) Downloaded 618 times
Vinlaell
Allie
Allie
Posts: 12
Joined: Mon Jan 11, 2010 12:47 pm

Re: First C program made by me :)

Post by Vinlaell »

good job man, looks very similar to my first c experiment too, but C is to me one of the hardest languages since it provides the low level access to get things done, thats why you need to use third party libraries for things like sockets/databases etc or it would most certainly NOT be easy to get a sproject done unlike with a newer managed language like C# you can just click a few times to get database access and widgets etc, C is only easy for making straight to the point tool applications.. like say your playing unreal tournament 3, unrealscript (game engines script language) does not give you access to execute commands on the pc's "cmd"thingie, but coding a C++ server that listenes on a local port for your videogame client to connect to it with unrealscripts "tcplink" class, you can send a command to the c++ server running on local pc to play a mp3, from within unrealscript ingame, this is actualy quite easy with C++and bridges the gap between ingame script and pc command execution.
TeamRetox
Allie
Allie
Posts: 222
Joined: Sat Jun 06, 2009 3:48 pm

Re: First C program made by me :)

Post by TeamRetox »

C++ > C badly
C is ugly :(

Code: Select all

#include <windows.h>
#include <iostream>
using namespace std;

int main()
{
    int number;
    cout<<"Enter a number to see if its bigger, lower or equal to 1337"<<endl;
    cin>>number;
    cout<<"You\'ve entered \""<<number<<"\", which is ";
    if(number<1337)
    {
        cout<<"smaller then 1337"<<endl;
    }
    else if(number>1337)
    {
        cout<<"bigger then 1337"<<endl;
    }
    else
    {
        cout<<"equal to 1337"<<endl;
    }
    return 1;
}
User avatar
Sethioz
Admin
Admin
Posts: 4762
Joined: Fri Jul 27, 2007 5:11 pm
Custom: Gaming YT > https://youtube.com/SethiozEntertainment
Game Hacking YT > https://youtube.com/sethioz
Game Hacks Store > https://sethioz.com/shopz
Location: unknown
Contact:

Re: First C program made by me :)

Post by Sethioz »

i did that after 1 day of reading about C, i don't think that there's many ppl who can do that without any knownledge of C at all.
I didn't know anything about C before that, i read about it one day (not whole day) and then wrote this, just to test if i can write something.
Post Reply