Skip to main content
Project predictor
In the three-field system the sequence of field use involved an autumn planting of grain (wheat, barley or rye) and a spring planting of peas, beans, oats or barley. The third was left fallow, in order to allow the soil of that field to regain its nutrients

The 3 durations(4 months each) are,
Duration 1: 1-4 (all inclusive)
Duration 2: 5-8 (all inclusive)
Duration 3: 9-12 (all inclusive)

The 2 crops that were used are, 
Crop 1: Winter Wheat
Crop 2: Beans

The initial crops in three fields at month 1are,
Field 1: Winter Wheat
Field 2: Beans
Field 3: Left Fallow

Given the month number and field number, write a program to print the crop name.

Input Format:
The first input is an integer corresponds to month number.
The second input is an integer corresponds to field number.

Output Format:
The output is the string.

Sample Input 1:
5
2
Sample Output 1:
Winter Wheat
 
Sample Input 2:
2
3
Sample Output 2:
Left Fallow
 
Sample Input 3:
2
2
Sample Output 3:
Beans


//Program
#include<stdio.h>
int main()
{
int mn,fn;
scanf("%d",&mn);
scanf("%d",&fn);
if(mn<=4)
{
    if(fn==1)
    {
        printf("Winter Wheat");
    }
    if(fn==2)
    {
        printf("Beans");
    }
    if(fn==3)
    {
        printf("Left Fallow");
    }
}
else if((mn>4)&&(mn<=8))
{
    if(fn==1)
    {
        printf("Left Fallow");
    }
    if(fn==2)
    {
        printf("Winter Wheat");
    }
    if(fn==3)
    {
        printf("Beans");
    }
}
if(mn>8)
{
    if(fn==1)
    {
        printf("Beans");
    }
    if(fn==2)
    {
        printf("Left Fallow");
    }
    if(fn==3)
    {
        printf("Winter Wheat");
    }
}


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; }
Ram starts explaining his son about the growth rate of organic farming and the future needs. Help Ram to display the growth rate, the area covered, pesticides used and other important information by writing a program. Input format: The first input is an integer which corresponds to the worldwide market. The second input is a float which corresponds to the growth rate. The third input is an integer which corresponds to the area. The third input is a string which corresponds to the pesticide. Output format: Refer the sample output. Sample Input and Output: World-wide market 653 Growth rate per annum from 2001-2011 18.1 Area 35460 Natural Pesticide Neem oil The World-wide market reached $653 billion with the growth rate of 18.1% in the period 2001-2011. The total area covered was 35460 hectares and Neem oil was used as a natural pesticide. //PROGRAM #include<stdio.h> #include<stdlib.h> #define max 500 int main() { int wwm; int area; float...
Fencing the ground Two non-overlapping fields need to be fenced together to guard from cattle. The fence is always a single rectangle, which cover the two fields exactly. Given the left bottom coordinate, length and width of the two fields, write a program to find dimension of the fence. Print “Invalid Input” if the fields overlap.   Input Format: The 1 st  line of the input consists of 4 integers separated by a space that correspond to x, y, l and w of the first rectangle. The 2 nd  line of the input consists of 4 integers separated by a space that correspond to x, y, l and w of the second rectangle. Output Format: Output consists of 4 integers that correspond to x, y, l and w of the Union rectangle. Sample Input 1: 0 2 4 3 4 0 2 8 Sample Output 1: 0 0 6 8   Sample Input 2: 0 2 4 3 3 0 2 8 Sample Output 2: Invalid Input //PROGRAM #include<stdio.h> int main() { int x1,x2,y1,y2,l1,l2,w1,w2,xmax,xmin,ymax,ymin; scanf("%d %d %d %d",&x1,...