Skip to main content

simple question with answers


Five friends have their gardens next to one another, where they grow three kinds of crops: fruits (apple, pear, nut, cherry), vegetables (carrot, parsley, gourd, onion) and flowers (aster, rose, tulip, lily).
 1. They grow 12 different varieties.
2. Everybody grows exactly 4 different varieties
3. Each variety is at least in one garden.
4. Only one variety is in 4 gardens.
5. Only in one garden are all 3 kinds of crops.
6. Only in one garden are all 4 varieties of one kind of crops.
7. Pear is only in the two border gardens.
8. Paul's garden is in the middle with no lily.
9. Aster grower doesn't grow vegetables.
10. Rose growers don't grow parsley.
11. Nuts grower has also gourd and parsley.
12. In the first garden are apples and cherries.
13. Only in two gardens are cherries.
14. Sam has onions and cherries.
15. Luke grows exactly two kinds of fruit.
16. Tulip is only in two gardens.
17. Apple is in a single garden.
18. Only in one garden next to Zick's is parsley.
19. Sam's garden is not on the border.
20. Hank grows neither vegetables nor asters.
21. Paul has exactly three kinds of vegetable.
 Who has which garden and what is grown where?
 

Ans

Hank:
pear
apple
cherry
rose
Sam:
cherry
onion
rose
tulip
Paul:
carrot
gourd
onion
rose
Zick:
aster
rose
tulip
lily
Luke:
pear
nut
gourd
parsley



Comments

Popular posts from this blog

FACTORIAL OF A NUMBER USING RMI IN JAVA

CLIENT PROGRAM: import java.io.*; import java.rmi.*; public class client { public static void main(String args[])throws Exception { try { String s="rmi://"+args[0]+"/abc"; serverint f=(serverint)Naming.lookup(s); DataInputStream m=new DataInputStream(System.in); int n1=Integer.parseInt(m.readLine()); System.out.println("the factorial is"+f.fact(n1)); } catch(Exception e) { System.out.println(e); } } } INTERFACE PROGRAM: import java.rmi.*; public interface serverint extends Remote { int fact(int n)throws Exception; } IMPLEMENTATION PROGRAM: import java.rmi.*; import java.rmi.server.*; public class serverimpl extends UnicastRemoteObject implements serverint { public serverimpl()throws Exception { } public int fact(int n) { int i,c=1; for(i=1;i<=n;i++) { c=i*c; } ret...

CREATE A PYRAMID PROGRAM IN C

#include<stdio.h> #include<conio.h> void main() {    int row, c, n, temp;    printf("Enter the number of rows in pyramid of stars you wish to see ");    scanf("%d",&n);    temp = n;     for ( row = 1 ; row <= n ; row++ )    {       for ( c = 1 ; c < temp ; c++ )          printf(" ");        temp--;        for ( c = 1 ; c <= 2*row - 1 ; c++ )          printf("$");        printf("\n");    }  getch(); } OUTPUT: Enter the number of rows in pyramid of stars you wish to see: 5 $ $$$ $$$$$ $$$$$$$ $$$$$$$$$
Write a c program or code to subtract two numbers without using subtraction operator #include <stdio.h> int main(){         int a,b;     int sum;     printf( "Enter any two integers: " );     scanf( "%d%d" ,&a,&b);     sum = a + ~b + 1;     printf( "Difference of two integers: %d" ,sum);     return 0; } Sample Output: Enter any two integers: 5 4 Difference of two integers: 1