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 to Generate Numbers in Pyramid Pattern
Friday, 7 Dec, 2007 – 8:47 | 10 Comments

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

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 | 3 Comments

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 | 6 Comments

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 …

C Program to Print a Character without using any Output Statements
Sunday, 25 Nov, 2007 – 6:45 | 6 Comments

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<stdio.h>
#include<conio.h>
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

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<stdio.h>
#include<conio.h>
#include<process.h>
#include<dos.h>
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

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<stdio.h>
char *program=”#include<stdio.h>%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);
}