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

What are the advantage of c language?

0 Answers  


without a terminator how can we print a message in a printf () function.

7 Answers   NIIT,


Predict the output or error(s) for the following: 25. main() { printf("%p",main); }

3 Answers   Google, ME,


what is the difference between structural,object based,object orientd programming languages?

1 Answers   PanTerra,


Explain output of printf("Hello World"-'A'+'B'); ?

0 Answers  






How to write the code of the program to swap two numbers with in one statement?

2 Answers  


What is the difference between specifying a constant variable like with constant keyword and #define it? i.e what is the difference between CONSTANT FLOAT A=1.25 and #define A 1.25

0 Answers  


Can include files be nested?

0 Answers  


main() { int x=10,y=15; x=x++; y=++y; printf("%d %d\n",x,y); } output??

19 Answers   EBS, Ramco, Sangwin, TCS,


program for following output using for loop? 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5

8 Answers   Aptech, Infosys,


#include show(int t,va_list ptr1) { int a,x,i; a=va_arg(ptr1,int) printf(" %d",a) } display(char) { int x; listptr; va_star(otr,s); n=va_arg(ptr,int); show(x,ptr); } main() { display("hello",4,12,13,14,44); }

0 Answers   Wilco,


How do you determine a file’s attributes?

0 Answers  


Categories