##Problem 2.7 :: Write a program to do the following:
(a) Declare x and y as integer variables and z as a short integer variable.
(b) Assign two 6 digit numbers to x and y.
(c) Assign the sum of x and y to z.
(d) Output the values of x, y and z.
## solution ::
## Write down headers yourself.
void main()
{
long x,y;
short z;
clrscr();
printf("Input two 6 digit number to x and y:");
scanf("%d %d",&x,&y);
z=x+y;
printf("\nx=%d",x);
printf("\ny=%d",y);
printf("z=%d",z);
getch();
}
Balagurusamy 2_7
Posted by Bijon Labels: ansi c balagurusamy, ansi c solutions, balagurusamy programming solution, c how to program solutions, c programing, c programming tutorial, homework solution, problem solutions, program solutions
Subscribe to:
Post Comments (Atom)


0 comments
Post a Comment