Starting with Basic 'C' programming

                             Lets get started with the basic programming in 'C'


                                                   1.Addition of two numbers.

#include<stdio.h>
#include<conio.h>
main()
{int a,b,c;
printf("Enter first number\n");
scanf("%d",&a);
printf("Enter second number\n");
scanf("%d",&b);
 c=a+b;
printf("Sum=%d",c);
getch();
                                                      }

2.Subtraction of two numbers

#include<stdio.h>
#include<conio.h>
main()
{int a,b,c;
printf("Enter first number\n");
scanf("%d",&a);
printf("Enter second number\n");
scanf("%d",&b);
 c=a-b;
printf("Difference=%d",c);
getch();
}

3. Multiplication of two numbers


#include<stdio.h>
#include<conio.h>
main()
{int a,b,c;
printf("Enter first number\n");
scanf("%d",&a);
printf("Enter second number\n");
scanf("%d",&b);
 c=a*b;
printf("Product=%d",c);
getch();
}

4.Divison of two numbers

#include<stdio.h>
#include<conio.h>
main()
{int a,b,c; float d;
printf("Enter first number\n");
scanf("%d",&a);
printf("Enter second number\n");
scanf("%d",&b);
d=a/b;
printf("Quotient=%d",d);
c=a%b;
printf("Remainder=%d",c);
getch();
}


3 comments:

  1. very informative post indeed.. being enrolled in http://www.wiziq.com/course/6314-learn-c-programming-language-low-priced-student-edition was looking for such articles online to assist me.. and your post helped me a lot

    ReplyDelete
  2. This comment has been removed by the author.

    ReplyDelete