plz answer....A program that takes 3 variables e.g a,b,c in
as seperate parameters and rotates the values stored so
that value goes a to b, b to c and c to a .

Answers were Sorted based on User's Feedback



plz answer....A program that takes 3 variables e.g a,b,c in as seperate parameters and rotates the..

Answer / venkatesh sabinkar

void main()
{
int a,b,c,t;
clrscr();
printf("enter the values of a, b and c");
scanf("%d%d%d",&a,&b,&c);
t=a;
a=b;
b=c;
c=t;
printf("a=%d,b=%d,c=%d",a,b,c);
getch();
}

Is This Answer Correct ?    9 Yes 7 No

plz answer....A program that takes 3 variables e.g a,b,c in as seperate parameters and rotates the..

Answer / swapnil chhajer

#include<stdio.h>

int main()
{
int a,b,c;
printf("Enter three numbers : ");
scanf("%d %d %d",&a,&b,&c);

a = a+b+c;
b = a-b-c;
c = a-b-c;
a = a-b-c;

printf("a : %d b: %d c: %d",a,b,c);
fflush(stdin);
getchar();
}

Is This Answer Correct ?    6 Yes 6 No

plz answer....A program that takes 3 variables e.g a,b,c in as seperate parameters and rotates the..

Answer / ruchi

#include<stdio.h>
#include<conio.h>
int main()
{
int a,b,c,d;
printf("\nEnter the three numbers ");
scanf("%d %d %d",&a,&b,&c);
a=a+b;
b=a-b;
d=c;
c=a-b;
a=d;
printf("\nNow the values are ");
printf("%d %d %d",a,b,c);
getch();
}

Is This Answer Correct ?    1 Yes 2 No

Post New Answer

More C Interview Questions

Can we add pointers together?

0 Answers  


What tq means in chat?

0 Answers  


What is #include called?

0 Answers  


How do you write a program which produces its own source code as its output?

4 Answers  


What are the two forms of #include directive?

0 Answers   Aspire, Infogain,






What is an anonymous union and where to apply that ?

3 Answers   HP,


What are disadvantages of C language.

0 Answers   iNautix,


Why do we use null pointer?

0 Answers  


Write a program to show the change in position of a cursor using c

0 Answers  


is c language is a object oreinted language?

5 Answers   TCS,


how memory store byte

4 Answers   Huawei,


How to reverse a linked list

1 Answers   Aricent, Fidelity, IBM, TCS,


Categories