Thursday 23 January 2014

/* WAP to find Factorial of a number using recursive function */

/* Factorial of a number using recursive function */

#include<stdio.h>
#include<conio.h>
int fact(int);
void main()
{
    int num;

    printf("Enter A Number:");
    scanf("%d",&num);

    printf("\n%d!=%d",num,fact(num));

    getch();
}

fact(int num)
{
    if(num<1)
    {
        return 1;
    }
    else
    {
        return (num*fact(num-1));
    }
}

/*WAP to find Factorial of a number using for loop */

/* Factorial of a number using for loop */

#include<stdio.h>
#include<conio.h>
void main()
{
    int num,i,fact=1;

    printf("Enter a Number:");
    scanf("%d",&num);

    for(i=1;i<=num;i++)
    {
        fact=fact*i;
    }

    printf("%d!=%d",num,fact);
}

/* WAP to Matrix subtraction */

/* Matrix subtraction */

#include<stdio.h>
#include<conio.h>
void main()
{
    int mat1[3][3],mat2[3][3],sub[3][3],i,j;

    printf("Enter the elements of  first matrix:\n");
    for(i=0;i<=2;i++)
    {
        for(j=0;j<=2;j++)
        {
            scanf("%d",&mat1[i][j]);
        }
    }

    printf("Enter the elements of  second matrix:\n");
    for(i=0;i<=2;i++)
    {
        for(j=0;j<=2;j++)
        {
            scanf("%d",&mat2[i][j]);
        }
    }

    for(i=0;i<=2;i++)
    {
        for(j=0;j<=2;j++)
        {
            sub[i][j]=mat1[i][j]-mat2[i][j];
        }
    }

    printf("The Sum Of Matrices Is:\n");
    for(i=0;i<=2;i++)
    {
        for(j=0;j<=2;j++)
        {
            printf("\t%d",sub[i][j]);
        }
        printf("\n");
    }
}

* WAP to concate strings */

/* WAP to concate strings */

#include<stdio.h>
#include<conio.h>
void main()
{
    char str1[100],str2[100],str[100];
    int i=0,j=0;

    printf("Enter First String:");
    gets(str1);

    printf("Entre Second String:");
    gets(str2);

    while(str1[i]!='\0')
    {
        str[j]=str1[i];
        i++;j++;
    }

    i=0;
    while(str[i]!='\0')
    {
        str[j]=str2[i];
        i++;j++;
    }

    printf("The Concate Of Entered Strings Is:");
    puts(str);

    getch();

}

/* WAP to convert the given character into uppercase if it is in lowercase and viceversa */

/* WAP to convert the given character into uppercase if it is in lowercase and viceversa */

#include<stdio.h>
#include<conio.h>
void main()
{
    char ch;

    printf("Enter a character:");
    scanf("%c",&ch);

    if(ch>='a' && ch<='z')
        printf("The uppercase character of %c is %c",ch,ch-32);
    else
        printf("The lowercase character of %c is %c",ch,ch+32);

    getch();
}

/* WAP to find the ASCII value of given character */

/* WAP to find the ASCII value of given character */

#include<stdio.h>
#include<conio.h>
void main()
{
    char ch;

    printf("Enter a character:");
    scanf("%c",&ch);

    printf("The ASCII value of %c is %d",ch,ch);

    getch();
}

/* WAP to arrange 5 given numbers in ascending order */

/* WAP to arrange 5 given numbers in ascending order */

#include<stdio.h>
#include<conio.h>
void main()
{
    int num[5],i,j,temp;

    printf("Enter 5 Numbers:");
    for(i=0;i<=4;i++)
    {
        scanf("%d",&num[i]);
    }

    for(i=0;i<=4;i++)
    {
        for(j=i+1;j<=4;j++)
        {
            if(num[i]>num[j])
            {
                temp=num[i];
                num[i]=num[j];
                num[j]=temp;
            }
        }
    }

    printf("Ascending order:");
    for(i=0;i<=4;i++)
    {
        printf("\n%d",num[i]);
    }

    getch();
}

,

/* WAP to Print the age of person in days */

/* WAP to Print the age of person in days  */

#include<stdio.h>
#include<conio.h>
main()
{
    int age,days;
    printf("Enter your age:");
    scanf("%d",&age);
    days=age*365;
    printf("You are %d days old.\n",days);
    getch();
}

Monday 20 January 2014

,

Write a program to read a number and to test whether it is an Armstrong number or not?

#include<stdio.h>
#include<conio.h>
void main()
{
    int num,temp,rem,sum=0;

    printf("Enter a number:");
    scanf("%d",&num);
    temp=num;

    while(temp!=0)
    {
        rem=temp%10;
        sum=sum+(rem*rem*rem);
        temp=temp/10;
    }

    if(sum==num)
        printf("\n%d is an Armstrong Number.",num);
    else
        printf("\n%d is not an Armstrong Number.",num);

    getch();
}

Friday 17 January 2014

Write a program to convert decimal to binary??

#include<stdio.h>
#include<conio.h>
void main()
{
    int dec,temp,bin[100],i=1,j;

    printf("Enter A Decimal Number:");
    scanf("%d",&dec);

    temp=dec;

    while(temp!=0)
    {
        bin[i++]=temp%2;
        temp=temp/2;
    }

    printf("The Equivalent Binary Number Of %d is ",dec);

    for(j=i-1;j>0;j--)
    {
        printf("%d",bin[j]);
    }

    getch();
}

Write a program to convert binary to deimal?


#include<stdio.h>
#include<conio.h>
void main()
{
    int bin,dec=0,temp,rem,j=1;

    printf("Enter Any Binary Number:");
    scanf("%d",&bin);

    temp=bin;

    while(temp!=0)
    {
        rem=temp%10;
        dec=dec+rem*j;
        j=j*2;
        temp=temp/10;
    }

    printf("The Equivalent Decimal Number Of %d is %d",bin,dec);
}

Thursday 16 January 2014

, ,

ASPHALT 8 download it for free.

Android HD racing game ASPHALT download it for free.

Asphalt 8 is one of the best HD android game. The graphic of asphalt 8 is amazing. You can now Perform barrel rolls and wild 360º jumps.In this game there are 8 seasons & 180 events in Career mode and more.

Minimum System Requirements of ASPHALT 8 ARE
1.2 GHZ cpu
512 MB of RAM
Adreno 203 GPU or better
1.5 gb free space


GOOGLE PLAY LINK :https://play.google.com/store/apps/details?id=com.gameloft.android.ANMP.GloftA8HM&hl=en
IF YOU CANT DOWNLOAD IT FROM GOOGLE PLAY HERE ARE OTHER LINKS:
FOR DATA AND APK CLICK HERE 





Wednesday 15 January 2014

/* Simple Program Displaying The Use Of Basic Mathematical Operators */

/* Simple Program Displaying The Use Of Basic Mathematical Operators */
#include<stdio.h>
#include<conio.h>
void main()
{
    int num1,num2,add,sub,multi,div,modulo_div;
    printf("Enter Two Numbers:");
    scanf("%d%d",&num1,&num2);
    add=num1+num2;
    sub=num1-num2;
    multi=num1*num2;
    div=num1/num2;
    modulo_div=num1%num2;
    printf("\nAddition=%d\nSubtraction=%d\nMultiplication=%d\nDivision=%d\nModulo Division=%d",add,sub,multi,div,modulo_div);
    getch();
}

OUTPUT


Example of printf and scanf.. (easy)

#include<stdio.h>
#include<conio.h>
void main()
{
int a,b,c;
printf("Example of printf and scanf\n");
printf("enter the value of a and b");
scanf("%d%d",&a,&b);
c=a+b;
printf("the sum is:%d",c);
getch();
}

Here printf prints the phrase Example of printf and scanf and enter the value of a and b. "\n" prints the phrase in a newline. Scanf stores the value of "a" and "b" entered by the user. "+" sign does the addition and store the value in c. Again printf prints the value of c.

Tuesday 14 January 2014

, ,

use of printf

printf("lets start\n");
This is the printf command and it prints text on the screen. The data that is to be printed is put inside brackets. You will also notice that the words are inside inverted commas because they are what is called a string. Each letter is called a character and a series of characters that is grouped together is called a string. Strings must always be put between inverted commas. The \n is called an escape sequence and represents a newline character and is used because when you press ENTER it doesn't insert a new line character but instead takes you onto the next line in the text editor. You have to put a semi-colon after every command to show that it is the end of the command.

C programming

C programming was  developed by Dennis Ritchie at bell laboartories  USA in 1972. C is used to prepare system software and application.
lets start with C basic knowledge.......Any instruction that starts with # (pre-processor operator) take up a whole line,and finish at the end of line which line is called pre-processor directive. Files ending with .h are what known as header files, provided with each compiler and cover a range of area such as string handling,mathematical conversions,printing and reading of variables etc. Stdio.h means "standard in/out" which means standard in/out which means standard way of getting data to and form input and output devices. In our case we whish to take in data from keyboard (a standard input devices) and put data on to the screen or console (a standard output device.)Conio.h means console in/out which means way of getting data to and from the console device(which uses the keyboard and screen)> Here stdio.h is more generalized and can be used to read/write data from to a disk file permanent storage of data, write data out out to a printing device ,and so on. The conio.h library just contains the deal specially with the console (keyword and black pop-up screen). Printf, scanf etc functions are defined in stdio.h header file whereas getcg(),clrscr() functions are defined in conio.h header file.
Another use of pre-processor operator is to define the variable globally like #define pi 3.14This global variable defination always comes before main function where a variable PI is assigned by value of 3.14
Any C program alwas starts with at most one main() function.void main(){ statements;}Here,void is return type of the function definition which returns nothing. `{` indicates the starts of main function and `}`indicates the end of main function.

Monday 13 January 2014

Free Net Connection In Airtel With out Gprs Activation

Tips To Get the Free Net connection In Airtel Live:-


 

Hi Friends everyone want to have the internet connection for free, but practically it wont possible in the real life because it was not provided by the server's like Airtel,Aircel,Vodafone. Here is the technique that was revealed here. Here this was discussed that the free internet connection without GPRS activation. But this was work only in the java phone's only ...

As soon as this was provided to the Android Phones.. 

This is the Nice trick To get the free Airtel GPRS:-

How To Do:-


  • First of all you need to activate the GPRS connection in the Handset or mobile phone..
                                          (Otherwise)                    
  • Then Call to the 121 and activate the GPRS connection.
  • If you Got GPRS connection then Follow the steps below.
  • Tea-Shark Web Browser which gives the free net Connection.
     

  • It also works in the Java Handset.
     

  • To Download this Click Here.
  •  This Trick is Most probably Work in all type of Handsets
  • Wanna Play game with Google Images Then Look at the last of this article.

Important Note :-


Viewers must be Check your Balance After few minutes of usage..

This software is only available in this site only .....

   
     This is an Excellent Technique Found in Airtel

     Check This out:- 

    Tips To Invite All Friend For Page likes......