Write a program to interchange two variables without using
the third variable?
Answer Posted / neelam
#include<stdio.h>
#include<conio.h>
void main()
{
int a,b;
clrscr();
printf("Enter two no.s 4 swap");
scanf("%d%d",&a,&b);
a=a+b;;
b=a-b;
a=a-b;
printf("After swapping no.s are =\n");
printf("a=%d b=%d",a,b);
getch();
}
| Is This Answer Correct ? | 0 Yes | 4 No |
Post New Answer View All Answers
Where are some collections of useful code fragments and examples?
What is a static function in c?
How does #define work?
if a is an integer variable, a=5/2; will return a value a) 2.5 b) 3 c) 2 d) 0
Is it possible to use curly brackets ({}) to enclose single line code in c program?
Write a program to swap two numbers without using a temporary variable?
What is pointers in c with example?
How can I open a file so that other programs can update it at the same time?
What is c method?
What would happen to X in this expression: X += 15; (assuming the value of X is 5)
1) There is a singing competition for children going to be conducted at a local club. Parents have been asked to arrive at least an hour before and register their children’s names with the Program Manager. Whenever a participant registers, the Program Manager has to position the name of the person in a list in alphabet order. Write a program to help the Program Manager do this by placing the name in the right place each time the Program Manger enters a name. The Logic should be written in Data Structures?
Given a valid 24 hour format time find the combination of the value and write a program ,do not hard the value and if any other inputs provided should work with the logic implemented Input: 11:30 Output: 13:10 Input: 18:25 Output: 21:58
What is the difference between procedural and functional programming?
Write a program to print “hello world” without using semicolon?
#define f(g,h) g##h main O int i=0 int var=100 ; print f ("%d"f(var,10));} wat would be the output??