Hello, OnlineGDB Q&A section lets you put your programming query to fellow community users. Asking a solution for whole assignment is strictly not allowed. You may ask for help where you are stuck. Try to add as much information as possible so that fellow users can know about your problem statement easily.

I want output of the program with suitable logic

–3 votes
asked Apr 5, 2020 by Rajeev Kumar (90 points)
int main()

{

char i;

if(i=0,1,2)

printf("Hello");

else

printf("Programmin in C");

printf("%c",i);

printf("World");

return 0;

}

2 Answers

+1 vote
answered Apr 6, 2020 by Nandan (170 points)
you have to used OR operator (||) in the if condition like:-

if(i=0||i=1||i=2)
0 votes
answered Apr 6, 2020 by 1916114 (260 points)
At first you didnt take the input from the keyboard ,whatever the value that i have initially thre programme runs on that ,i.e. asskey value,first initate to some other known value and in the code take input from the keyboard
Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and and receive answers from other members of the community.
...