Answer:
//Here is the for loop in C.
for(n=10;n>0;n--)
{
printf("count =%d \n",n);
}
Explanation:
Since C is a procedural programming language.Here if a loop that starts with n=10; It will run till n becomes 0. When n reaches to 0 then loop terminates otherwise it print the count of n.
// here is code in C++.
#include <bits/stdc++.h>
using namespace std;
// main function
int main()
{ // variables
int n;
// for loop that runs 10 times
// when n==0 then loop terminates
for(n=10;n>0;n--)
{
cout<<"count ="<<n<<endl;
}
return 0;
}
Output:
count =10
count =9
count =8
count =7
count =6
count =5
count =4
count =3
count =2
count =1
Answer:
public static void printDottedLine(){
System.out.print(".....\n");
}
Explanation:
This method returns nothing so its return type is void
It also accepts no parameters so the argument list is empty
When called it executes the System.out.print(".....\n"); which prints out 5 dots
See a complete program below:
public class TestClock {
public static void main(String[] args) {
printDottedLine();
}
public static void printDottedLine(){
System.out.print(".....\n");
}
}
It would take 2 consultants 30 hours to create a slide deck of 120 slides.
Explanation:
Rate of slide making by one consultant- 2 slides per hour
Target- 120 slides
2 consultants are employed in the job-
Since 2 consultants are employed in the job, total rate of making slides per hour would be 4 slides/hour (2*2 slides/hour)
Time required to complete 120 slides= total slides/rate of doing slides per hour
Substituting the values, we get
Time required= 120/4= 30 hours
Hence, it would take 30 hours for 2 consultants to create a slide deck of 120 slides.
Answer:
Option A(True) is the correct answer for the above question.
Explanation:
- An array is used for the collection variables which is of the same type and uses memory in continuous Passion for the storage.
- When any user wants to use the array then he needs to declare the size and type of the array because array holds the same type of data.
- For example, int a[5] is an array of integer variable whose name is 'a' and the size is 5 in c language.
- Anyone can use the array with the help of the index value of the array. The starting index value is 0 and the ending index value is (size-1) for any array.
- The user can use it by the help of loop, in which the loop variable refers to the index of the array and it starts from 0 and ends in the (size of the array-1).
- It is because the loop executes the same line multiple times.
- The above statement also wants to state, which is defined as above. Hence the above statement is true which is referred by option A. Hence option A is the correct answer.