Showing posts with label C-Programs. Show all posts
Showing posts with label C-Programs. Show all posts

Sunday, 30 October 2016

Halloween Program in C

Halloween  program using C

This Halloween wish your friend in a new style.... 
Make  a C Program to wish your friend using a C program. 
Edit as you want...


Tutorial Video:

 

Code:  

#include <stdio.h>
#include <wchar.h>
#include <stdlib.h>
#include <locale.h>
int i,j;
void delay()
{

    for(i=0; i<1000; i++)
        for(j=0; j<3000; j++)
        {}
}
void delay1()
{
    for(i=0; i<100000; i++)
        for(j=0; j<3000; j++)
        {}
}
void change()
{
        system("COLOR C");
        delay1();
        system("COLOR F");
        delay1();
        system("COLOR E");
        delay1();
        system("COLOR 8");
        delay1();
}
int main(void)
{
    char *locale = setlocale(LC_ALL, "");
    FILE *in = fopen("Halloween.txt", "r");
    wint_t c;
    system("COLOR E");
    while ((c = fgetwc(in)) != WEOF)
        {   if(c!=' ')
            delay();

            putwchar(c);
        }
    fclose(in);
    while(1)
    {
        change();
    }
    getch();
}

 
OUTPUT :

Download Halloween.txt

Download the Full Project

 

 

Saturday, 29 October 2016

Happy Diwali.. This Diwali wish your friend in a new style....

Diwali Wish  program using C

This Diwali wish your friend in a new style.... 
Make  a C Program to wish your friend using a C program. 
Edit as you want...


Tutorial Video:

 

Code:

#include <stdio.h>
#include <wchar.h>
#include <stdlib.h>
#include <locale.h>
int i,j;
void delay()
{

    for(i=0; i<1000; i++)
        for(j=0; j<3000; j++)
        {}
}
void delay1()
{
    for(i=0; i<100000; i++)
        for(j=0; j<3000; j++)
        {}
}
void change()
{system("COLOR 9");

        delay1();
        system("COLOR C");
        delay1();
        system("COLOR 5");
        delay1();
        system("COLOR E");
        delay1();
}
int main(void)
{
    char *locale = setlocale(LC_ALL, "");
    FILE *in = fopen("Diwali.txt", "r");
    wint_t c;
    system("COLOR E");
    while ((c = fgetwc(in)) != WEOF)
        {   if(c!=' ')
            delay();

            putwchar(c);
        }
    fclose(in);
    while(1)
    {
        change();
    }
    getch();
}

Output:

Download Diwali.txt

Download the Full Project


 


Wednesday, 19 October 2016

C Program to convert a uppercase letter into lowercase or lowercase into uppercase

This is a C Program to convert a uppercase letter to lowercase. This is done by the ASCII values .

So You can see the difference between ASCII values of 'A' and 'a' is 32. So we have to add 32 to get lowercase of a uppercase letter. Click 'Read More' for the code.

C Program to Swap two values or numbers using two varriable

This is a C program to swap two variable values(a,b). This is done using two variables only.

Code:
#include <stdio.h>
#include<conio.h>
void main()
{int a,b;
    printf("\t\t\t Swaping the values\n");
    printf("Enter the values of a and b");

scanf("%d%d",&a,&b);
printf("Before  swapping \n a=%d \n b=%d",a,b);
a=a+b;
b=a-b;
a=a-b;
printf("\nAfter swapping \n a=%d \n b=%d",a,b);
getch();
}

Output:

Enter the values of a and b 5 8
Before  swapping
 a=5
 b=8
After swapping
 a=8
 b=5

Tuesday, 18 October 2016

C Program to Swap two values or numbers using third varriable

This is a C program to swap two variable values(a,b). This is done using a third variable(c).

Code: 
#include<stdio.h>
#include<conio.h>
void main()
{int a,b,c;
    printf(" \t\t\t\tSwapping the values\n");
    printf("Enter value of a ");
    scanf("%d",&a);
    printf("Enter value of b ");
    scanf("%d",&b);
    c=a;
    a=b;
    b=c;
    printf("\n\nAfter Swapping: \n\nValue of a = %d and value of b = %d",a,b);
    getch();
}

Output:

Here Code blocks & gcc compiler is used for the programming.

C Program to check Odd or Even number

This  is a c program to check a  number  is even or odd. For this we first take a input(integer number) from the user and then checks whether it is divided by 2 or not.If it is divided by 2 then it is an even number else it is a odd number.
Code:

#include<stdio.h>
#include<conio.h>
void main()
{int a;
    printf("\t\t\tOdd or even Checker");
    printf("\nEnter a number ");
    scanf("%d",&a);
    if(a%2==0)
        printf("\n This is an even number");
    else
        printf("\n This is an odd number.");
        getch();
}


C Program to display area and perimeter of any object (like circle)

Here the code is used to get or display the area and perimeter of a circle. You can change the formula
for your required object .

C Code: 

#include<stdio.h>
#include<conio.h>
void main()
{float r,area,peri;//(float examples 3.14,2.19,9.999.)
printf("\t\t\tFind the Perimeter and area of a circle");
printf("\n\nEnter the radius of the Circle ");
scanf("%f",&r);
area=3.14*r*r;
peri=2*3.14*r;//We take the value of pi as 3.14.
printf("\nThe Area of the Circle is %f",area);
printf("\nThe Perimeter of the Circle is %f",peri);
getch();
}

Monday, 12 September 2016

C Program to add two numbers(Integer)

This is a simple C Program to add two numbers(Integer)
I have used Code Blocks to build the program.
I also suggest you to use Code Blocks for C-Programming.
Here is a guide for beginners > How to use Code Blocks for C-Programs.

Code:

#include<stdio.h>

int main()
{
    int a,b,c;//To declare three integer variables
    printf("\t\t\tAddition of two numbers\n");
    printf("Enter two values\n");
    //To take input value of a and b from the user
    scanf("%d%d",&a,&b);

    //To perform the addition
    c=a+b;//c is assigned the value of (a+b)

    //To print the result
    //%d is used to indicate an integer
    //the value of c is printed in place of %d
    printf("The addition is %d",c);

    return 0;
}




Output :

                        Addition of two numbers
Enter two values
7
3
The addition is 10

Download the C-File

C Program to Display Your Name

This is a C Program to Display Your Name using c programming.
I have used Code Blocks to build the program.
I also suggest you to use Code Blocks for C-Programming.
Here is a guide for beginners > How to use Code Blocks for C-Programs.

Code : 

//This will include the Standard Input and Output(stdio) Header File
#include<stdio.h>
 


//this is the main function from where the program execution starts 
int main()

{   

    //printf is a function which remains under stdio.h
    //printf is used print some texts
    printf("Satyadipan Maiti");
    

    return 0;
}


Output :

Satyadipan Maiti

Download the C-File




Thursday, 8 September 2016

Question Set Generator

Generate a question set containing 6 questions at each set using a C program with random numbers 1-16 where the condition is that two adjacent question set does not contain any same question.

For Example:---
Set[1]--> 12  03  11  10  08  04
Set[2]--> 01  14  02  07  05  09
Set[3]--> 16  04  13  08  03  11
Set[4]--> 14  10  01  07  09  12
Set[5]--> 05  13  03  06  16  15
Set[6]--> 14  12  08  01  07  02


Wednesday, 1 July 2015

Birthday Wish Program in C with source code


Are you learning C? Want to wish your friend with a c program? Here is a perfect program for you.
I used Code Blocks for building this program. This is a very good open source, cross platform application. If you don't have it  Download it.
Click Read more to download the program.I added the  download  link of the program with source code bellow.Download & Modify as you want.


Now Let me give a short description about the program:--

First I have created a text file("Happy.txt") and write the birthday wish there.

You can extend the text file with your friend's name or anything you want.

Then I have opened the file in read mode and printed the file in console window.

I have used a function delay to print the character one by one


Screenshots:



Tuesday, 30 June 2015

Word Guessing Game in C with source code

This is word guessing game to check how much you know your partner. How much    your thought match with your partner.
I added the game file download link with source code bellow.Download & Modify as you want.
I used Code Blocks for building this program. This is a very good open source, cross platform application. If you don't have it  Download it.

Screenshots:


Game Instruction : 
Your partner will enter 3 words. 
You have to guess the word.
Your partner can give hints to you. 
The less hint you use the higher you score.