Showing posts with label mnd. Show all posts
Showing posts with label mnd. Show all posts

Oct 12, 2012

Introducing long

Long is a type of data that allows a plenty of numbers, if you need to show too much numbers, here's your type. By the way, signed and unsigned not work for long. Unsigned int is the same memory space for long, so use it as you want.

#include <stdio.h>

main()
{
      long st, nd;
     
      printf("Enter the first number ");
      scanf("%d", &st);
      printf("Enter the second number ");
      scanf("%d", &nd);
      printf("The result is %d", st * nd);
      getchar();
      getchar();
      getchar();
}

Introducing unsigned and signed

Just looking the signed and unsigned instructions, to be simple, unsigned is for numbers that are positive ONLY, and the signed is for negative numbers. This instructions goes before the data type, example, unsigned int. Here's an example code.

#include <stdio.h>

main()
{
      int st;
      signed int nd;
      unsigned int rd;
     
      st = -1;
      nd = -2;
      rd = 3;
     
      printf("The first number is %d", st);
      getchar();
      printf("The second number is %d", nd);
      getchar();
      printf("The third number is %d", rd);
      getchar();
}

Mnd is learning Java!

Yeah, I know. I got "afk" for three days but I'm back, I'll post that three codes that I got to post, sorry, blame my god-dammed exams.
Now I'm trying to learn Java for Android development so, when I do my first program, I'll upload a .zip with the entire project, I use Eclipse IDE.
I've done a "Hello, World" Android app (it's so easy, just do a new project and Eclipse creates a project with "Hello, world!" code by default) but there's too, TOO MUCH to learn.
So stay tuned!