رد: CPCS 202: Project 1 ،، للنقاش والمساعدة !
Example 3: A program to interchange values of two variables with a use of 3rd variable.
/* Still another class to test variables */
public class Variables3 {
public static void main (String [] args) {
int a = 5, b=10, c ;
System.out.println(“Value of A and B before interchange”+ a + “ “ + b);
c=b;
b=a;
a=c;
System.out.println(“Value of A and B After interchange”+ a + “ “ + b); }
}
شوفو هادا السؤال تقريبا نفس الفكرة ياارب اكون افدتكم
لاتنسوني من دعواتكم
|