Write a program that takes three variables(a,b,c) in as
separate parameters and rotates the values stored so that
value a goes to b,b,to c and c to a
Answer Posted / rajesh bhansali
#include<stdio.h>
main()
{
int x, y, z, a;
printf("Type values of x, y and z\n");
scanf("%d %d %d",&x,&y,&z);
printf("On rotation we found the following values
assigned to x,y,z.\n");
a=z;
z=x;
x=y;
y=a;
printf("x=%d, y=%d, z=%d", x,y,z);
getch();
}
| Is This Answer Correct ? | 62 Yes | 12 No |
Post New Answer View All Answers
Explain what is the difference between functions abs() and fabs()?
What is difference between structure and union in c programming?
What is pointer in c?
Why is it important to memset a variable, immediately after allocating memory to it ?
What is the difference between text and binary i/o?
How do we print only part of a string in c?
Why can’t constant values be used to define an array’s initial size?
explain what is a newline escape sequence?
What are the types of c language?
A banker has a seif with a cipher. Not to forget the cipher, he wants to write it coded as following: each digit to be replaced with the difference of 9 with the current digit. The banker chose a cipher. Decipher it knowing the cipher starts with a digit different than 9. I need to write a program that takes the cipher from the keyboard and prints the new cipher. I thought of the following: Take the input from the keyboard and put it into a string or an array. Go through the object with a for and for each digit other than the first, substract it from 9 and add it to another variable. Print the new variable. Theoretically I thought of it but I don't know much C. Could you give me any kind of hint, whether I am on the right track or not?
What is the advantage of an array over individual variables?
What are void pointers in c?
Can variables be declared anywhere in c?
A program is required to print your biographic information including: Names, gender, student Number, Cell Number, line of study and your residential address.
What do you mean by scope of a variable in c?