GoHacking.com: Ethical Hacking and Cyber Security
EMAIL SECURITY

Tips to Secure and Safeguard Your Email Account

HOW STUFFS WORK

Articles Explaining How Everything Works!

HOW-TO GUIDES

How-To Articles on Various Subjects

INTERNET SECURITY

Tips for a Safe and Secure Internet Usage

NETWORK HACKS

Network Hacking Techniques Exposed!

Home » Archive by Category

Articles in the C SOURCE CODES Category

C Program for Pigeon Breeding Problem
Thursday, 28 Feb, 2008 – 16:33 | 8 Comments
C Program for Pigeon Breeding Problem

The problem is as follows…
Initially I have a pair of adult pigeons (capable of breeding) which give rise to another young pair every month until it reaches the age of 5 years (60 months). But …

C Program to Set/Change the Current System Date
Wednesday, 16 Jan, 2008 – 13:56 | 5 Comments
C Program to Set/Change the Current System Date

This program can be used to set the system date or to change the current system date.
 
 
 
#include <stdio.h>
#include <process.h>
#include <dos.h>
int main(void)
{
struct date reset;
struct date save_date;
getdate(&save_date);
printf(“Original date:\n”);
system(“date”);
reset.da_year = 2001;
reset.da_day = 1;
reset.da_mon = 1;
setdate(&reset);
printf(“Date after setting:\n”);
system(“date”);
setdate(&save_date);
printf(“Back to …

C Program to Get the Current System Date
Wednesday, 16 Jan, 2008 – 13:47 | One Comment
C Program to Get the Current System Date

This program will get or read the current system date from the system. It displays Year, Month and Day.
 
 
 
 
#include <dos.h>
#include <stdio.h>
int main(void)
{
struct date d;
getdate(&d);
printf(“The current year is: %d\n”, d.da_year);
printf(“The current day is: %d\n”, d.da_day);
printf(“The current …

C Program to Set/Change the Current System Time
Wednesday, 16 Jan, 2008 – 11:50 | No Comment
C Program to Set/Change the Current System Time

This program can be used to set or change the system time
#include <stdio.h>
#include <dos.h>
int main(void)
{
struct time t;
gettime(&t);
printf(“The current hour is: %d\n”, t.ti_hour);
printf(“The current min is: %d\n”, t.ti_min);
printf(“The current second is: %d\n”, t.ti_sec);
/* Add one to …

C Program to Get the Current System Time
Wednesday, 16 Jan, 2008 – 11:30 | 2 Comments
C Program to Get the Current System Time

This program reads the current system time and displays it in the form HH:MM:SS
#include <stdio.h>
#include <dos.h>
int main(void)
{
struct time t;
gettime(&t);
printf(“The current time is: %2d:%02d:%02d\n”, t.ti_hour, t.ti_min, t.ti_sec);
return 0;
}

C Program to Generate Random Numbers
Wednesday, 16 Jan, 2008 – 11:10 | 8 Comments
C Program to Generate Random Numbers

This is a simple program to generate random numbers. This logic can be used to build a Lotto program or a program to pick Lucky number and so on. Here’s the program
#include<stdio.h>
#include <stdlib.h>
#include <time.h>
int main(void)
{
int …

C Program To Accept Password
Tuesday, 11 Dec, 2007 – 12:46 | 12 Comments
C Program To Accept Password

This is a simple login program in C. While accepting password it masks each character using ‘*’ symbol and display the password in the next line after the user hits Enter key. It also accepts …

How to Create a Computer Virus?
Friday, 7 Dec, 2007 – 9:17 | 81 Comments
How to Create a Computer Virus?

This program is an example of how to create a virus in C. This program demonstrates a simple virus program which upon execution (Running) creates a copy of itself in the other file. Thus it …