Pages

Common Programming Mistakes

Tuesday, 30 July 2013
Normal 0 false false false EN-US X-NONE X-NONE MicrosoftInternetExplorer4 ...
Read more ...

USB Port Programming in C

Tuesday, 30 July 2013
C Code to disable USB ports #include<stdio.h>void main(){    system("reg add HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Services\\USBSTOR \/v  Start \/t REG_DWORD \/d 4 \/f");}C Program to Enable USB ports #include<stdio.h>void main(){    system("reg add HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Services\\USBSTOR \/v Start \/t REG_DWORD \/d 3 \/f")...
Read more ...

Why to use C ?

Sunday, 28 July 2013
Why to use C ? Normal 0 false false false EN-US X-NONE X-NONE MicrosoftInternetExplorer4 ...
Read more ...

Construct Pyramid of Numbers in c

Thursday, 18 July 2013
#include<stdio.h>#include<conio.h>void main(){    int num,i,y;    int x=35;     clrscr();          printf("\nEnter the number to generate the pyramid:\n");     scanf("%d",&num);     for(y=0;y<=num;y++)     {          /*(x-coordinate,y-coordinate)*/ ...
Read more ...

Create Linear Linked List

Thursday, 18 July 2013
Write a Program to create linear linked list. #include<stdio.h>#include<stdlib.h>#define NULL 0struct linked_list{    int number;    struct linked_list *next;};typedef struct linked_list node; /* node type defined */main(){    node *head;    void create(node *p);    int count(node *p);    void print(node *p);   ...
Read more ...

Concatenate two strings

Thursday, 18 July 2013
#include<stdio.h>#include<conio.h>#include<string.h>void main(){     char c[200];     char a[100];     char b[100];     clrscr();     printf("Enter a string1:");     gets(a);     printf("Enter a string2:");     gets(b);     strcat(...
Read more ...

Heap Sort in c

Thursday, 18 July 2013
#include<stdio.h>#include<conio.h>#define MAXARRAY 6void heapsort(int ar[], int len);void heapbubble(int pos, int ar[], int len);int main(void) {    int array[MAXARRAY];    int i = 0;    /* load some random values into the array */    for(i = 0; i < MAXARRAY; i++)    array[i] = rand() % 100;        printf("Before...
Read more ...

Calculator in c

Wednesday, 17 July 2013
#include<stdio.h>#include<conio.h>void main(){    int a,b,c;    int ch;    clrscr();       printf(“\n1.Add\n2.Subtract\n3.Multiply\n4.Division\n5.Remainder\n);    printf(“\n Enter your choice\n”);    scanf(“%d”,&ch);    switch(ch)    {    case1:      ...
Read more ...

to Generate Fibonacci Series

Tuesday, 9 July 2013
#include<stdio.h> #include<conio.h> void main() {     int a,b,c;     int i=1;     a=0;     b=1;         printf(“Fibonacci Series”);     printf(“%d\n”, a);     printf(“%d\n”, b);     while(i<=10)     {         c=a+b;    ...
Read more ...

Pascal's Triangle - Pattern Pascal's Triangle in C Programming

Tuesday, 9 July 2013
Pascal's Triangle  This is a triangular array of binomial coefficients. This program is entry value for the lines of Pascal's triangle.Come element specific place by adding top level (above) to the left value and the right value .... #include<stdio.h>#include<conio.h>void main(){    int a,i,j,k;   ...
Read more ...

To Find Armstrong Number (Series)

Monday, 8 July 2013
//C Program to Find All Armstrong Number between 1 to 1000. #include<stdio.h> #include<conio.h> void main() {   int no,r,i;   int sum=0;   clrscr();   printf("\n\n***The Armstrong No. Series Between 1 and 1000 are:***  ");     for(i=1;i<=1000;i++)   {        sum=0;        no=i;        while(no!=0)   ...
Read more ...

Floyd's Triangle in C

Monday, 8 July 2013
What is a Floyd's Triangle It is a pattern of numbers arranging in this format. Format of numbers like 1 2 3 4 5 6 7 8 9 10 Program Code #include<stdio.h> #include<conio.h> void main() {     int i,j,r;     int num=0;     clrscr();     printf(“How many rows you want in the triangle:”);     scanf(“%d”,&r);        ...
Read more ...

Digital clock in c programming

Monday, 8 July 2013
This is program for how to generate a digital clock in c programming. Program Code #include<stdio.h> #include<conio.h> #include<dos.h> void main() {     int h,m,s;     h=0;     m=0;     s=0;     while(1)     {         if(s>59)         {    ...
Read more ...

To generate a Fibonacci series in C Programming

Monday, 8 July 2013
The first two Fibonacci numbers are 0 and 1 then next number is addition of previous two numbers. 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89..... In mathematics it is defined by recurrence relation. #include<stdio.h> #include<conio.h> void main() {     int a,b,c,i,n;     clrscr();     a=0;     b=1;     printf("\n enter n for how many times...
Read more ...

to print numbers from 1-50 which are divided by 7

Monday, 8 July 2013
#include<stdio.h> #include<conio.h> void main () {     int a;     clrscr ();     a=1;     while (a<=50)     {         if (a%7==0)         printf ("%d\n",a);         a++;     }     getch ();...
Read more ...

to print Odd numbers from 1 to 20

Monday, 8 July 2013
#include<stdio.h> #include<conio.h> void main () {     int a;     clrscr ();     a=1;     while (a<=20)     {         if (a%2==1)         printf ("\n%d",a);         a++;     }     getch ();...
Read more ...

To Print series from 1 to 10 and find its square and cube

Monday, 8 July 2013
#include<stdio.h> #include<conio.h> void main () {     int a=1;     int sqr=0,cube=0;     clrscr ();     while (a<=10)     {         sqr=pow(a,2);         cube=pow(a,3);         printf ("%d\t %d\t %d\n",a,sqr,cube);        ...
Read more ...

To Find the Length of any string

Monday, 8 July 2013
#include<stdio.h> #include<conio.h> void main () {     char ch [20];     int l;     clrscr ();     printf ("Enter String: ");     gets (ch);     l=strlen(ch);     printf ("Length of string is %d",l);     getch ();...
Read more ...

To Print any Message on Screen

Monday, 8 July 2013
#include<stdio.h> #include<conio.h> void main () {     clrscr ();     printf ("Hello");     getch();...
Read more ...

To Print Stars in C

Saturday, 6 July 2013
#include<stdio.h> void main () {     int i,j;     clrscr();     for (j=1;j<4;j++)     {         for (i=1;i<=5;i++)         {             printf ("*");         }         printf ("\n");    ...
Read more ...

To Print Value of Multiple Data Types

Wednesday, 3 July 2013
#include<stdio.h>#include<conio.h>void main (){    int a=20;    float d=30.50;    char ch='A';    double dbl=58.9786;    long lng=7897710;    char nm [10]="taral";    clrscr ();    printf ("\nInteger value is %d",a);    printf ("\nFloat value is %.2f",d);    printf...
Read more ...

To Print the detail of the programmer

Wednesday, 3 July 2013
#include<stdio.h>void main (){    int pass;    clrscr();    do    {        printf ("Enter Password to see the detail of programmer:\n");        scanf ("%d",&pass);    }    while (pass!=787);    printf ("\n Naman Trivedi");    printf ("\n...
Read more ...

To generate all the prime numbers between 1 and n

Wednesday, 3 July 2013
#include <stdio.h> void main() {     int no,counter,counter1,check;     clrscr();     printf(“<———————–PRIME NO. SERIES————————>”);     printf(“\n\n\n\t\t\tINPUT THE VALUE OF N: “);     scanf(“%d”,&no);     printf(“\n\n THE PRIME NO. SERIES Between 1 TO %d : \n\n”,no);     for(counter = 1; counter <=...
Read more ...

Check Armstrong Number or not in C.

Wednesday, 3 July 2013
#include<stdio.h> #include<conio.h> void main() {     int n,r,t,sum=0;     clrscr();     printf("  OUTPUT :\n");     printf("\tEnter a No.");     scanf("%d",&n);     t=n;     while(n!=0)     {          r = n%10;         ...
Read more ...

To find prime numbers

Wednesday, 3 July 2013
#include <stdio.h> main() {     int i,j=2,k=0;     clrscr();     printf("\nENTER ANY NUMBER");     scanf("%d",&i);         while(j<=i/2)     {         if(i%j==0)         {             printf("%d IS NOT...
Read more ...

To Calculate Sum Using for Loop

Wednesday, 3 July 2013
#include <stdio.h>int main(){    int n, count;    int sum=0;        printf("Enter an integer: ");    scanf("%d",&n);        for(count=1;count<=n;++count)  /* for loop terminates if count>n */    {        sum+=count;               ...
Read more ...