Best Blogger Tips

C SOURCE CODES

Share


Articles in the C SOURCE CODES Category

A Virus Program to Disable USB Ports
Sunday, 19 Jul, 2009 – 17:42 | 43 Comments
A Virus Program to Disable USB Ports
In this post I will show how to create a simple virus that disables/blocks the USB ports on the computer (PC). As usual I use my favorite C programming language to create this virus. Anyone with …
How to Make a Trojan Horse
Sunday, 5 Apr, 2009 – 18:41 | 81 Comments
How to Make a Trojan Horse
Most of you may be curious to know about how to make a Trojan or Virus on your own. Here is an answer for your curiosity. In this post I’ll show you how to make a simple …
A Virus Program to Block Websites
Friday, 21 Nov, 2008 – 8:46 | 65 Comments
A Virus Program to Block Websites
Most of us are familiar with the virus that used to block Orkut and Youtube site. If you are curious about creating such a virus on your own, here is how it can be done. As …
A Virus Program to Restart the Computer at Every Startup
Friday, 17 Oct, 2008 – 8:49 | 99 Comments
A Virus Program to Restart the Computer at Every Startup
Today I will show you how to create a virus that restarts the computer upon every startup. That is, upon infection, the computer will get restarted every time the system is booted. This means that …
File Embedder Project in C
Monday, 21 Jul, 2008 – 8:40 | 8 Comments
File Embedder Project in C
Some times it is necessary for our compiled project to have it’s supporting files embedded within the EXE module itself so that the supporting files may not be put into a seperate folder and carried …
C Program Without a Main Function
Monday, 3 Mar, 2008 – 1:20 | 34 Comments
C Program Without a Main Function
How to write a C program without a main function?. Is it possible to do that. Yes there can be a C program without a main function. Here’s the code of the program without a …
Guessing Game In C
Saturday, 1 Mar, 2008 – 8:14 | 7 Comments
Guessing Game In C
This is a small guessing game written in C. In this guessing game you have to guess a number between 0 & 100. You have 8 chances to do that. Every time you guess wrongly …
A Self Destructing Program in C
Saturday, 1 Mar, 2008 – 7:35 | 21 Comments
A Self Destructing Program in C
This program will destroy itself upon execution. The program will cause the .exe file to be deleted upon execution. That is this program is capable of destroying itself upon execution. Here is the code
 
 
#include
#include
#include
void main()
{
printf(“This …
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
#include
#include
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
#include
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
#include
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
#include
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
#include
#include
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 …
C Program to Generate Numbers in Pyramid Pattern
Friday, 7 Dec, 2007 – 8:47 | 10 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 | 4 Comments
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
void main()
{
int i=0;
unsigned …
C Program to display the No. of Digits in an Entered Number
Monday, 3 Dec, 2007 – 12:13 | 2 Comments
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
#include
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 | 6 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
#include
char str[]=”Hello …
C Program to Print a Character without using any Output Statements
Sunday, 25 Nov, 2007 – 6:45 | 6 Comments
C Program to Print a Character without using any Output Statements
This program can be used to print character without using any output statements. This program only works in 16-bit mode since it directly writes to VDU Memory.
 
 
#include
#include
void main()
{
char far *p=(char far *)0xb8000000;
*p=’A’;
getch();
}
C Program to Remove Comments and Blank lines from a valid C Program
Saturday, 24 Nov, 2007 – 12:03 | 10 Comments
C Program to Remove Comments and Blank lines from a valid C Program
This program accepts any valid C Program as an input and removes the comments and blanks from it. The output is a program that has no comments and blank lines.
#include
#include
#include
#include
void main()
{
FILE *a,*b;
char fname[20],ch,tch=NULL,tch1=NULL;
int flag1=0,flag=0,count=0,count1=0,count2=0;
clrscr();
printf(“Enter the …
Program to Print it’s Own Source Code
Saturday, 24 Nov, 2007 – 11:15 | 10 Comments
Program to Print it’s Own Source Code
Here is a C program to print it’s own source code. That is the output of this program is exactly same as it’s source code. Here’s the program
#include
char *program=”#include%cchar *program=%c%s%c;%cvoid main()%c{%cprintf(program,10,34,program,34,10, 10,10,10);%c}”;
void main()
{
printf(program,10,34,program,34,10,10,10,10);
}

0 comments:

Post a Comment