Answer:
The correct answer is:
C. ndx = 0;
while (ndx < 3) {
ar[ndx] = 0;
ndx++;
}
Explanation:
The declaration given is:
int ar[3];
This means the array consists of three locations and is named as ar.
We know that the indexes are used to address the locations of an array and the index starts from 0 and goes upto to 1 less than the size of the array which means the indexes of array of 3 elements will start from 0 and end at 2.
Now in the given options we are using ndx variable to run the while loop.
So the code to assign zero to all elements of array will be
ndx = 0;
while(ndx<3)
{
ar[ndx] = 0;
ndx++;
}
Hence, the correct answer is:
C. ndx = 0;
while (ndx < 3) {
ar[ndx] = 0;
ndx++;
}
Answer:
The C language code is a class called Test that accepts an array, duplicates it, reinitializes the first array to the first two items of the previous array, and loops through the array to print both items.
Explanation:
public class Test{
public static void main(String args[]){
int[] x={1,2,3,4}; //here declare array x with 1 2 3 4
int[] y=x; //here copy the x array into y array
x=new int[2]; //here reintilized the array size which is 2
for(int i=0;i<.length;i++){ //here now array length is 2 it iterates 2 times
System.out.print(x[i]+" ");
}
}
Answer:
#include<iostream>
using namespace std;
int main(){
char str[20];
int i=0;
std::cout<<"Enter a name:" ;
cin>>str;
cout<<*str;
while(str[i]!='\0'){
if(str[i]==' '){
i++;
cin>>*(str+i);
}
i++;
}
return 0;
}
Answer:
i dont under stand it ........
Explanation:
Required tools and components:
Soldering iron
Solder
Flux pen
Fine gauge solder (23 gauge or finer)
Wire cutter
MAX31855 thermocouple interface chip (available directly from Maxim Integrated)
Thermocouple with junction suitable for your application (e.g., probe, washer, etc.)
J-type (-40°C to +750°C)
K-type (-200°C to +1350°C)
T-type (-200°C to +350°C) Solid state relay (will depend on your application)
USB FTDI 5V cable (Note: A single cable can be used for many different microcontroller projects)
Computer with Arduino IDE v1.0
Wall-wart 9V/1.5A, 2.1mm center positive