Tuesday, 17 April 2012

Get the value from user

Today we did some simple calculation with the values taken from the user
we have taken 2 numbers and then did the following calculations
1. Adding  2. subtracting 3. multiplication 4. divination
 Here is the code block

#include <stdio.h>
main()
{
    int i,j,result;
      printf("Write the two numbers you want to work with: " );
      scanf("%d %d", &i,&j);
      result= i+j;
      printf(" %d + %d = %d\n",i,j,result );  
      result = i-j;
      printf(" %d -  %d = %d\n",i,j,result ); 
      result = i*j;
      printf(" %d *  %d = %d\n",i,j,result ); 
      result = i/j;
      printf(" %d /  %d = %d\n",i,j,result );
      system("PAUSE");
      return 0; 
   }


Result window


Thursday, 12 April 2012

Addition in C 10/04/2012

Here is our first mathematical solution by using C. just adding two numbers
#include <stdio.h>
main()
{
    int i=6,j=9;
    int result;
    result = i+j;
    printf("The addition of 6 and 9 is %d\n", result); //this one will print the given data and text
    system("PAUSE");
    return 0;
}

the  screen is given below

Hello World ! Our first program in C

Here is our first program helloworld.c

#include <stdio.h>
main()
{
     printf("Hello World\n") ; //this one will print the given data and text

     system("PAUSE") ; // to see the result  devc++ editor need this command
}


here is the output of this program

Wednesday, 11 April 2012

Inaguration of computer club

Hello,
We have formed a new club. here we are going to publish the news of our club.