Answer:
// here is code in c++.
// include headers
#include <bits/stdc++.h>
using namespace std;
// main function
int main()
{
// variables
long long int minutes,years,days;
long long int s;
cout<<"please enter the minutes:";
// read the minutes
cin>>minutes;
// make a copy
s=minutes;
// calculate days
days=minutes/1440;
// calculate years
years=days/365;
// calculate remaining days after years
days=days%365;
// print the result
cout<<s<<" minutes is equal to "<<years<<" years "<<days<<" days."<<endl;
return 0;
}
Explanation:
Read the number of minutes from user and assign it to variable "minutes" of long long int type.Make a copy of input minutes.Then calculate total days by dividing the input minutes with 1440, because there is 1440 minutes in a day.Then find the year by dividing days with 365.Then find the remaining days and print the output.
Output:
please enter the minutes:1000000000
1000000000 minutes is equal to 1902 years 214 days.
Answer:
Following are the code in the C language .
int max(int x) // function definition
{
static int largest=0; // variable declaration
if (x>largest) // checking the condition
largest=x; // assign the value of input in the largest variable
return largest; // return the largest number
}
Explanation:
Following are the description of code .
- Decalred a function max of int type which hold a parameter x of int datatype.
- In this function compared the number x with the largest .If this condition is true then largest number hold the value of x variable
- Finally return the largest number .
Answer:
The correct code to the given question is
if ((counter % 10) == 0) // check the condition
{
System.out.println("Counter is divisible by ten: " + counter); // display
}
else // check the condition
{
System.out.println("Counter is not divisible by ten: " +counter); // display the //value
}
counter++; // increment the value of counter
Explanation:
Following are the description of code
- In the given question we have to check the condition that the given number is divisible by 10 or not .
- In the if block if the number is divisible by 10 then it print the value of number and increment the value of counter .
- In the else block if the number is not divisible by 10 then it print the value of number and increment the value of counter .
- It means the value of counter is increases in the if block as well as in the else block .So we have to remove the counter statement from there and place outside the if and else block .
Answer:
Explanation:
Asymmetric cryptography, is a cryptographic system that uses two different types of keys both public and private keys. Symmetric cryptography on the other hand uses the same type of key for both encryption. The benefit of using a combination when transferring data across the internet is that Asymmetrical cryptography is necessary to establish a secure connection while symmetrical cryptography can enhance the speed of the data transmission after connection has been established, thus both provide a unique benefit.