Skip to main content
Plantation
A certain crop grown in a sunny and hot climate needs more water per day than the same crop grown in a cloudy and cooler climate. There are, however, apart from sunshine and temperature, other climatic factors which influence the crop water need. These factors are humidity and wind speed. When it is dry, the crop water needs are higher than when it is humid. In windy climates, the crops will use more water than in calm climates.
The highest crop water needs are thus found in areas which are hot, dry, windy and sunny. The lowest values are found when it is cool, humid and cloudy with little or no wind.

Given 3 crops along with the range of the amount of water required and the temperature range.
Crop 1: Rice – 5 to 10 cm , 20 to 27 degree celcius, all  inclusive.
Crop 2: Wheat – 12 to 15 cm, 21 to 24 degree celcius, all inclusive.
Crop 3: Cotton – 6 to 13 cm, 18 to 30 degree celcius, all inclusive.
  Note: Follow the above crops order.

Determine what all crops can be planted, given the rainfall and temperature.

Input format:
The first input is an integer which corresponds to the water required.
The second input is an integer which corresponds to the temperature.

Output format:
Output is a string or a list of strings.
If there are multiple strings in the output, the order to be followed is Rice, Wheat, Cotton.

Sample Input 1:
6
20
Sample Output 1:
Rice
Cotton

Sample Input 2:
15
21
Sample Output 2:
Wheat

//C PROGRAM
#include<stdio.h>
int main()
{
int a,b;
scanf("%d",&a);
scanf("%d",&b);
if(((a>=5) && (a<=10)) && ((b>=20) && (b<=27)))
printf("Rice\n");
if(((a>=12) && (a<=15)) && ((b>=21) && (b<=24)))
printf("Wheat\n");
if(((a>=6) && (a<=13)) && ((b>=18) && (b<=30)))
printf("Cotton\n");

return 0;

}

Comments

Popular posts from this blog

C Program To Calculate The Revenue The demand for organic food increases every year by 8.9%. Write a program to find the increase in revenue after 3 years. Given the revenue in the first year is ‘x’ crores. Input Format: The first line of the input is an integer that corresponds to the ‘x’ value. Output Format: Output is a float value that corresponds to the revenue after 3 years, rounded off to 2 decimal places. Sample Input: 4 Sample Output: 5.17 //PROGRAM #include<stdio.h> int main() {     int x,i;     float rev;     scanf("%d",&x);     rev=x;     for(i=0;i<3;i++)     {         rev=rev*(1.089);     } printf("%.2f",rev); return 0; }
CROP DETAILS Crop Details A small farmer, Mr.John, use to grow different crops every year in his field. All the crops are being grown using goat manure, farmyard manure, groundnut and neem cake. All the crops are grown organically. He got high yield by using sufficient water and fertilizers at in this year. He will sell his crops in the market. In the market, he wants to maintain the details of each crop that are purchased by customers. Details like crop name, the weight of the crop, cost of the crop Display the details of crops in ascending order of crop names. Create a structure called crop. struct crop{ char cropName[30]; float weight; int cost; }; Input and Output Format: Refer sample input and output for formatting specification. All float values are displayed correctly to 2 decimal places. All text in bold corresponds to the input and the rest corresponds to output. Sample Input and Output: Enter the number of Crops 2 Enter the details of Crop 1 Enter name...
STRUCTURE:BUILDING Structures : Building Create a structure called Building. struct Building { char name[100]; float length; float width; float height; float ratePerSqFt; }; Write a program to get the details of 'n' buildings and to display the name, area and rate for painting the inner side of the building per square feet of each building, sorted by name in ascending order. Length, width and height of the building are given in feet. The flooring is also done with the same rate. Input and Output Format: Refer sample input and output for formatting specification. All float values are displayed correct to 2 decimal places. All text in bold corresponds to input and the rest corresponds to output. Sample Input and Output: Enter the number of buildings 2 Enter the details of building 1 Enter name Vikram Enter length 200 Enter width 150 Enter height 10 Enter rate per square feet 650.5 Enter the details of building 2 Enter name Ganesh Enter length 1...