int sum = 0, n;
do {cin>>n; sum+=n;}while (n!=0);
cout<<sum;
Answer:
They are both ways to identify assets (e.g., persons, animals, objects).
Explanation:
A barcode is a bit of information (usually a number) printed as a line or block pattern on a surface (e.g., a sticker).
An RFID is a bit of computer memory with an antenna.
Both can be read with the appropriate scanner device.
Answer:
class Main {
public static void printPattern( int count, int... arr) {
for (int i : arr) {
for(int j=0; j<count; j++)
System.out.printf("%d ", i);
System.out.println();
}
System.out.println("------------------");
}
public static void main(String args[]) {
printPattern(4, 1,2,4);
printPattern(4, 2,3,4);
printPattern(5, 5,4,3);
}
}
Explanation:
Above is a compact implementation.
Answer:
long power(int i)
{
return pow(2,i);
}
Explanation:
The above written function is in C++.It does not uses loop.It's return type is long.It uses the function pow that is present in the math library of the c++.It takes two arguments return the result as first argument raised to the power of second.
for ex:-
pow(3,2);
It means 3^2 and it will return 9.
Answer:
Differences between Object Oriented Programming and Structured Programming
1. Structured programming focuses on process/logic then data while OOP(Object Oriented programming) focuses on data.
2.OOP supports Inheritance,Encapsulation,Abstraction,Polymorphism while structured programming does not supports these.
3.Structured programming follows top-down approach while OOP follows bottom-up approach.
4.OOP is more secured than structured programming because it supports Abstraction (data hiding).