Binaries compiled with gcc against e.g. glibc (the gnu standard c libary), which is shared by ubuntu and tinycore can run directly on each system (as long as there aren't any compatibility issues like different architecture, gcc profiles, etc.). There's no need for converting anything.
To what you are referring is the package format for extensions. Whereas ubuntu uses .deb and fedora uses .rpm, tinycore uses .tcz. Although there are differences in the type and technique of files (.tcz is squashfs, .rpm is compressed cpio archive, etc.), it's basically the same on distros to use it. When you want to use a .tcz on tinycore you "install" it with tce-load -i /path/to/file.tcz or with a -w switch to download it from the web.
What you can do is, make an own extension for your hello world program, you will need compiletc and squashfs-tools-4.x extensions (download with appbrowser or tce-load -wi):
$ mkdir -p myext/usr/local/bin
$ gcc -o myext/usr/local/bin/helloworld helloworld.c
$ sudo chown -R root:staff myext
$ sudo mksquashfs myext myext.tcz
$ md5sum myext.tcz > myext.tcz.md5.txt
Then copy myext.tcz and myext.tcz.md5.txt to your tce folder (that is a folder called tce on any mountable partition, e.g. /mnt/sda1/tce) into the folder optional and edit a file called onboot.lst with myext.tcz in a line. Example:
/mnt/sda1/tce/onboot.lst
/mnt/sda1/tce/optional/myext.tcz
$ cat /mnt/sda1/tce/onboot.lst
myext.tcz
If you added or recreated new partitions (USB key or whatever) then run on a terminal
$ sudo rebuildfstab
$ sudo mount /dev/sda1
Tinycore will use the tce folder on any drive automatically as long as the device is already connected when booting. If you use an USB drive for that, add to your bootcodes waitusb=6, so that there's time for tinycore to recognize the device and mount it.