Language: JavaScript
Answer:
let num = [10,20,30];
average(num);
function average(num) {
let sum = 0;
for(let i in num) {
sum += num[i];
}
return console.log(sum/num.length);
}
Answer:
The answer is a on edge2020.
:D have a great day and stay safe <3.
Big difference
Loops allow you to execute code multiple times while a condition is true
Functions allow you to “call” a snippet of code whenever you want, and you can pass it arguments that could affect the data it returns
Answer:
1.In the first query the column Z of table xyz wil change and set to its default value so we use alter command .
Syntax :ALTER TABLE TABLENAME ALTER COLUMN NAME SET DEFAULT VALUE
So SQL query is :
ALTER TABLE XYZ ALTER Z SET DEFAULT 9999 ;
This query will Change the column Z of a table XYZ to acceptdefault value 9999 .
2.In the second query we delete a table from database so we use DROP command .
Syntax :DROP TABLE TABLENAME;
So SQL query is :DROP TABLE XYZ;
This query will delete the table from database.
3.In the last query we have to change the column Z from table again we use alter command .
Syntax:ALTER TABLE TABLENAME DROP COLUMN COLUMNNAME ;
So SQL query is :
ALTER TABLE XYZ DROP COLUMN Z;
This query will delete column Z from the table XYZ.
Explanation:
Array is collection of similar data types it is a linear data structure.Array stores elements in a contiguous memory location.
We have an array arr[5] of size 5 and it is of integer type.Suppose the starting address of the array is 2000 and each memory location is one byte long.As we know that the size of integer is 2 or 4 bytes we take it 2 bytes.
If the starting address is 2000 that is of index 0 then the address of index 1 is 2000+2=2002.
address of index 2=2004.
address of index 3=2006.
address of index 4=2008.
Since size of int is 2 bytes hence we add two memory location.