Wednesday, September 8, 2010

how to wrte a program for Subtraction of any two number in C-program ?

#include
#include

main()
{
int a,b,c;
clrscr();
printf("\n\n\t\t\t\t* SUBTRACTION *");
printf("\n\n\n\tEnter any number :\t");
scanf("%d",&a);
printf("\n\tEnter any number :\t");
scanf("%d",&b);
c=a-b;
printf("\n\t Subtraction\t :\t%d",c);
getch();
}


how to wrte a program for mutliplication of any two number in C-program ?

#include
#include

main()
{
int a,b,c;
clrscr();
printf("\n\n\t\t\t\t* MULIPLICATION *");
printf("\n\n\n\tEnter any number :\t");
scanf("%d",&a);
printf("\n\tEnter any number :\t");
scanf("%d",&b);
c=a*b;
printf("\n\tMultiplication\t :\t%d",c);
getch();
}


how to write a program for Division of any two number in C-programing ?

#include
#include

main()
{
int a,b,c;
clrscr();
printf("\n\n\t\t\t\t* DIVISION *");
printf("\n\n\n\tEnter any number :\t");
scanf("%d",&a);
printf("\n\tEnter any number :\t");
scanf("%d",&b);
c=a/b;
printf("\n\t Division \t :\t%d",c);
getch();
}


How to write Addition of Any two number programing in C ?

#include
#include

main()
{
int a,b,c;
clrscr();
printf("\n\n\t\t\t\t* ADDITION *");
printf("\n\n\n\tEnter any number :\t");
scanf("%d",&a);
printf("\n\tEnter any number :\t");
scanf("%d",&b);
c=a+b;
printf("\n\t Addition \t :\t%d",c);
getch();
}


how write a program to take student information such as Name, Roll No., and Two subject marks and the display the all information by calclulating of table 2 subject ?

#include
#include
void main()

{
char a[20];
int b;
int c,d,e;
clrscr();
printf("\n\t\t\t*** student structure ***");
printf("\n\n\t Enter the student name\t\t:\t");
scanf("%s",&a);
printf("\n\t Enter the student Roll No.\t:\t");
scanf("%d",&b);
printf("\n\t Enter your maths marks \t:\t");
scanf("%d",&c);
printf("\n\t Enter your since marks \t:\t");
scanf("%d",&d);
e=c+d;
printf("\n\t Your total subject marks\t:\t%d",e);

printf("\n\n\n\n\t\t\t*** student Information ***");

printf("\n\n\t Student Name\t\t\t:\t%s",a);
printf("\n\n\t Student Roll No. \t\t:\t%d",b);
printf("\n\n\t Student Total subject marks\t:\t%d",e);

getch();
}


get it?

how write a program to swaping any two number without using 3rd variable ?

#include
#include

void main()

{

int a,b;
clrscr();

printf("\n\t Enter the any value of A \t:\t");
scanf("%d",&a);
printf("\n\t Enter the any value of B \t:\t");
scanf("%d",&b);
a=a+b;
b=a-b;
a=a-b;
printf("\n\t After swaping the value of A is\t:\t%d",a);
printf("\n\t After swaping the value of B is\t:\t%d",b);
getch();

}