Here is a somewhat cryptic solution that works:
#include <algorithm>
#include <cstdlib>
using namespace std;
void q(char c, int count)
{
for (int i = 0; i < count; i++) {
putchar(c);
}
}
void p(int b1, int plusses)
{
q(' ', b1);
q('+', plusses);
}
int main()
{
for (int i = -3; i <= 3; i++)
{
int pl = min(6, (3 - abs(i)) * 2 + 1);
p(6-pl, pl);
i == 0 ? p(0, 6) : p(6, 0);
p(0, pl);
putchar('\n');
}
getchar();
}
Answer:
// program in C++.
#include <bits/stdc++.h>
using namespace std;
// main function
int main()
{
// variable
int inp_month;
cout<<"Enter month:";
// read month
cin>>inp_month;
// if month is february
if(inp_month==2)
cout<<"Number of days in month:28"<<endl;
// if month is 4 or 6 or 9 or 11
else if(inp_month==4||inp_month==6||inp_month==9||inp_month==11)
cout<<"Number of days in month:30"<<endl;
else
// for others month
cout<<"Number of days in month:31"<<endl;
return 0;
}
Explanation:
Read month from user and assign it to variable "inp_month".If month is 2 then there is 28 days in the month.If input month is 4 or 6 or 9 or 11 then there is 30 days in the month.For other month there will be 31 days in month.We assume there is no leap year.
Output:
Enter month:4
Number of days in month:30
Answer:
Data can be stored on storage devices.
Explanation:
Network security, Application security and information security are the securities that protect data. Data can be stored on storage devices such as hard disk drives, solid state drives, external hard drives, USB flash drives and SD cards etc. Hard disk drives, floppy disks and tapes store data magnetically. The data can be stored with a device that spins the disk with magnetic coatings and heads has the ability to read and write information in the form of magnetic patterns.