Write a c language | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
0

Write a c language

8. There are four types of fruits Apples, Oranges, Bananas and Grapes. Each student can pick up two fruits. There are some conditions which have to be used to pick up the fruits. Draw a flow chart which can take the name of first fruit as an input and print the names of second fruit or fruits that can be picked up. The conditions are: ā¢ If you pick an apple you can pick banana. ā¢ If you pick orange you can pick grapes. ā¢ If you pick grapes you can pick banana. Hint: There will be one input box to read the first fruit, three decision boxes and four output boxes in the flowchart. Use ā ā for string and == operator.

25th Apr 2021, 5:25 PM
KODURU VIVEK SAI REDDY
5 Respostas
+ 3
Vivek Post your attempt first to get help from the community .And Try to solve these challenges yourself as far as possible for your own progress ...
25th Apr 2021, 5:32 PM
Alphin K Sajan
+ 2
#include<stdio.h> #include<string.h> void main() { printf("Picking of fruit\n"); printf("PICK ANY TWO FRUITS FROM \nAPPLE\nBANANA\nGRAPE\nORANGE\n"); char "apple","orange","banana","grape"; char i[10]; int n; gets(i); n = 0; while(n<2) { if (i=="apple"||i=="Apple") { printf("U CAN PICK BANANA also\n"); } else if(i=="orange"||i=="Orange") { printf("U CAN PICK GRAPES also\n"); } else if(i=="grapes"||i=="Grapes") { printf("U CAN PICK BANANA also\n"); } else if(i=="banana"||i=="Banana") { printf("U CAN PICK APPLE also\n"); } n+=1; if(n<2) { gets(i); } } } '
26th Apr 2021, 4:21 AM
KODURU VIVEK SAI REDDY
+ 1
Is their any worng let me note it
26th Apr 2021, 4:21 AM
KODURU VIVEK SAI REDDY
0
Go and see this answer and go and learn it
26th Apr 2021, 6:57 PM
KODURU VIVEK SAI REDDY
- 1
// Created by Vivek #include<stdio.h> #include<string.h> int main() { printf("Picking of fruit\n"); printf("PICK ANY TWO FRUITS FROM \nAPPLE\nBANANA\nGRAPE\nORANGE\n"); char i[10]; int n; gets(i); n = 0; while(n<2) { if (!strcmp(i,"apple")||!strcmp(i,"Apple")) { printf("U CAN PICK BANANA also\n"); } else if(!strcmp(i,"orange")||!strcmp(i,"Orange")) { printf("U CAN PICK GRAPES also\n"); } else if(!strcmp(i,"grapes")||!strcmp(i,"Grapes")) { printf("U CAN PICK BANANA also\n"); } else if(!strcmp(i,"banana")||!strcmp(i,"Banana")) { printf("U CAN PICK APPLE also\n"); } n+=1; if(n<2) { gets(i); } } return 0; }
26th Apr 2021, 6:56 PM
KODURU VIVEK SAI REDDY
Quente hoje
run python
0 Votes
coding error
0 Votes