Write a program to swap 2 chars without using a third
varable?
char *s = "A";
char *p = "B";
Answer Posted / rajesh rvp
#include <stdio.h>
int main ()
{
int i;
char c,d,temp;
scanf("%c %c",&c,&d);
If (toascii (c)>toascii (d))
{
temp=c;
c=d;
d=temp;
}
return 0;
}
| Is This Answer Correct ? | 2 Yes | 0 No |
Post New Answer View All Answers
Explain differences between new() and delete()?
What is the best way to take screenshots of a window with c++ in windows?
Why is standard template library used?
What is a syntax in c++?
Explain one-definition rule (odr).
What operators can you overload in c++?
the maximum length of a character constant can be a) 2 b) 1 c) 8
what are the iterator and generic algorithms.
what are the decision making statements in C++? Explain if statement with an example?
Program to check whether a word is a sub-string or not of a string typed
Can you be able to identify between straight- through and cross- over cable wiring? And in what case do you use straight- through and cross-over?
Why is main an int?
what is software cycle? What is a mission critical system ? What is the important aspect of a real-time system ? Explain the difference between microkernel and macro kernel. Give an example of microkernel.Why paging is used ? Which is the best page replacement algo and Why ? What is software life cycle ? How much time is spent usually in each phases and why Which one do U want to work if selected in Honeywell ? Which are the different types of testing ? What is a distributed system ? Some questions about CSP. Which languages do U know ? What are the differences between Pascal and C. questions from Compiler construction and Lisp. Which are the different computer architecture? What is the requirement in MIMD ? What is the difference between RISC and CISC processors ? Difference between loosely coupled and tightly coupled systems ? What is an open system?
Explain the properties and principles of oop.
What are the comments in c++?