Input format:
The first input is an integer that corresponds to the year.The second input is a string that corresponds to the fertilizer.
The third input is a string that corresponds to the technique.
Output format:
Refer to the sample output.Sample Input and Output:
[All text in bold corresponds to Input and the rest corresponds to output]Welcome to Organic Farming
Year
1972
Fertilizer
Compost Manure
Technique
Crop Rotation
Organic Farming was introduced in the year 1972. It relies on Compost Manure and many places emphasize Crop Rotation as a technique.
PROGRAM
#include <stdio.h>#include <stdlib.h>
#define max 400
int main()
{
int year;
char fert[max]={0};
char tech[max]={0};
printf("Welcome to Organic Farming\n");
printf("Year\n");
scanf("%d",&year);
printf("Fertilizer\n");
getchar();
gets(fert); //to get string with spaces
printf("Technique\n");
gets(tech);
printf("Organic Farming was introduced in the year %d. It relies on %s and many places emphasis %s as a technique.",year,fert,tech);
return 0;
}
Comments
Post a Comment