create 3 arraye A ,B and C of size 5.Accept numbers in two arrays A and B.Fill all the elements of array C with the sum of numbers present in appropriate element of array A and B
Answers
Answer:
Explanation:
l = [("item1",12.5),("item",2.3),("item",7.0)]
[i for i in l if i[1] > 9]
# [('item1', 12.5)]
Which is equivalent to the following for loop:
new_list = []
for i in l:
if i[1] > 9:
new_list.append(i)
print(new_list)
# [('item1', 12.5)]
Or for values smaller than 9:
[i for i in l if i[1] < 9]
# [('item', 2.3), ('item', 7.0)]
Program
import java. util. *;
public class Main {
public static void main(String[] args) {
Scanner SC = new Scanner (System. in );
int a[]= new int [5];
int b[]= new int [5];
int c[]= new int [5];
for (int i =0;i<a.length ;i++ ){
{
System. out. println("Enter the a");
a[i]=SC. nextInt();
}
{
System. out. println("Enter the b");
b[i]=SC. nextInt();
}
c[i]=a[i]+b[i];
System. out. println("The sum of a and b ="+c[i]);
}
}
}
Note this program is typed in Jvdroid
And this is Java program
And I think this program is useful to you.