Write a program to print the swapping in two no and using
three variable.

Answers were Sorted based on User's Feedback



Write a program to print the swapping in two no and using three variable...

Answer / guest

int a=10,b=20;
a=a+b;
b=a-b;
a=a-b;
S.o.pln(a);
S.o.pln(b);

Is This Answer Correct ?    17 Yes 4 No

Write a program to print the swapping in two no and using three variable...

Answer / saiteja gangisetty

#include<stdio.h>
void main()
{
int a,b,temp;
printf("enter a, b values");
scanf("%d%d",a,b);
temp=a;
a=b; (or) // b=a*b/a=b;
b=temp;
printf("a=%d and b=%d",a,b);
}

Is This Answer Correct ?    7 Yes 0 No

Write a program to print the swapping in two no and using three variable...

Answer / anshuman jha

#include<iostream.h>

#include<conio.h>

void main()

{

int a,b,c;

clrscr();

cout<<"Enter the two different no :";

cin>>a>>b;

cout<<"After swapping :"<<a<<b;

c=a;

a=b;

b=c;

cout<<"Before swapping :"<<a<<b;

getch();

}

Is This Answer Correct ?    9 Yes 4 No

Write a program to print the swapping in two no and using three variable...

Answer / manasa bugude

import java.util.Scanner;

public class SwappMethod {

public static void main(String[] args)
{
int a,b,c,d;
Scanner scn=new Scanner(System.in);
System.out.println("enter the value of a,b and c");
a=scn.nextInt();
b=scn.nextInt();
c=scn.nextInt();
System.out.println("before swapping numbers:"+a+" "+b+" "+c);
d=a;
a=b;
b=c;
c=d;
System.out.println("after swapping number:"+a+" "+b+" "+c);
System.out.println();

}

}

Is This Answer Correct ?    0 Yes 0 No

Write a program to print the swapping in two no and using three variable...

Answer / anonymous

import java.util.*;
class S3v
{
public static void main(String args[])
{
int a,b,c;
Scanner s=new Scanner(System.in);
a=s.nextInt();
b=s.nextInt();
c=a-b;
a=a-c;
b=b+c;
System.out.print(a+" "+b);
}
}

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More STL Interview Questions

Describe the elements of Microsoft Word screen. Write down steps for creating, saving, retrieving, editing and printing a document.

2 Answers  


Question 1)Read the data from one file and remove all the duplicated words and generate an output file containg only using words.Program should also print number of occurance of each words on standard output.(Program must be use STL and iostream object). Question 2)Write a program to convert the lower case contents of file to upper case using STL. Question 3)What is the output of this problem. int i=12; int &r =i; r+r/4; int +p =&r; int *p = &r; P+=r; return 1; Answer :a)12 b)17 c) 30 d)24 E)15 Question 4) #include #include #include void main() { char srcstr[30],desstr[30]; int i,len; clrscr(); cout<<"\nenter the string\n"; cin>>srcstr; len=strlen(srcstr); for(i=0;srcstr[i]!='\0';i++) { desstr[--len]=srcstr[i]; } desstr[i]='\0'; cout<<"\nreversed string is\n"; for(i=0;desstr[i]!='\0';i++) { cout< } getch(); } Answer : A) string output b)tuptuo gnirts c) string d)output Question 5) Class Test { static const Tk=LEN; int q; public: foo(intx =LEN):q(x){}; TGet Q() const { return q:} void call test Foo<long :9> foo(10); std::const<< foo.Getq(); Answer: 7,8,9,10,11 question 6) class A { int a; char b; }; class B:public A { char b; int a; }; What is the size? Answer a)5 bytes for class A and 5 bytes class B b)4 bytes for class A and 8 bytes class B. c).... d)....

2 Answers   Bally Technologies,


Describe the My Computer and My Documents folders; identify the elements that are present in every Window.

0 Answers  


What does stl stand for in basketball?

0 Answers  


Explain how to insert a hyperlink in to an Excel worksheet and save a Word document as a Web page.

1 Answers  






write a program to search and display the position of an element in a single-dimentional array using function.

1 Answers  


Who created stl?

0 Answers  


method overloading means what?

2 Answers   CTS,


What is the stl, standard template library?

0 Answers  


What are stl algorithms?

0 Answers  


What is a standard template library (stl)? What are the various types of stl containers?

0 Answers  


write a program that input four digit no and finds it is palindrome or not

2 Answers  


Categories