EMAIL SECURITY

Useful Tips to Secure your Email Account

HOW-TO GUIDES

How-To Articles and Software Tutorials

INTERNET SECURITY

Useful Tips for a Safe & Secure Internet Usage

NETWORK HACKS

Network Hacking Techniques Exposed!

VIRUS CREATION

Learn How to Create Viruses on your Own

Home » Archive by Category

Articles in the C SOURCE CODES Category

C Program to Get the Current System Date
Wednesday, 16 Jan, 2008 – 13:47 | No 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 | One Comment
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 | 7 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 | 7 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 …

C Program to Generate Numbers in Pyramid Pattern
Friday, 7 Dec, 2007 – 8:47 | 3 Comments
C Program to Generate Numbers in Pyramid Pattern

This C program generates the numbers in pyramid pattern. It takes the input from two through nine and generates the numbers in the pyramid pattern. For example if the input is 4 then the program …

C Program to Print the Entered Number in Words
Tuesday, 4 Dec, 2007 – 16:32 | One Comment
C Program to Print the Entered Number in Words

The following C program print’s the entered number in words. For example if the number entered is 12345 then the program prints the entered number in words as One Two Three Four Five
 
 
#include<stdio.h>
void main()
{
int i=0;
unsigned …

C Program to display the No. of Digits in an Entered Number
Monday, 3 Dec, 2007 – 12:13 | No Comment
C Program to display the No. of Digits in an Entered Number

This program displays the number of digits present in the number that is entered through the input.
#include<stdio.h>
#include<conio.h>
void main()
{
unsigned long int num;
int i=0;
clrscr();
printf(“Enter the digit\n”);
scanf(“%lu”,&num);
while(num!=0)
{
num=num/10;
++i;
}
printf(“Length=%d”,i);
getch();
}

Program To Print A String Without Using Any Output Statements
Friday, 30 Nov, 2007 – 13:39 | 5 Comments
Program To Print A String Without Using Any Output Statements

This program can be used to print a string without using any output statements such as printf, puts etc. However this program only works in 16-bit mode since it directly writes to VDU Memory
 
#include<stdio.h>
#include<conio.h>
char str[]=”Hello …