can any one convert below code into c programe | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
- 2

can any one convert below code into c programe

#include<iostream> using namespace std; int main() { char ch; do{ cout<<"hi"<<endl; cin>>ch; }while(ch=='y'); return 0; }

5th Jun 2021, 2:54 PM
just commedy
just commedy - avatar
6 Answers
+ 3
We don't work for you . Go through c language syntax and do it yourself , if you get stuck feel free to ask a question. it's not even like you need to go through every syntax in c , just search how to take input and display something , as well how do while loop work in c .
5th Jun 2021, 3:02 PM
Abhay
Abhay - avatar
+ 1
If ch = 'y' then the cycle will be infinite.
5th Jun 2021, 3:06 PM
Solo
Solo - avatar
0
Looking at your profile, you have completed enough C course to do this on your own. What's the difficulty then ?
5th Jun 2021, 3:51 PM
Arsenic
Arsenic - avatar
0
#include<stdio.h> int main() { char ch; do{ printf("hi\n"); scanf("%c",&ch); }while(ch=='y'); return 0; } is this ok... bt bro output diffrent , in c it come out from the loop after 2 round. while in c++ it is continue till i responding with y
5th Jun 2021, 6:29 PM
just commedy
just commedy - avatar
0
You are wrong, these codes work exactly the same.
5th Jun 2021, 6:56 PM
Solo
Solo - avatar
0
whose who thick above codes are give same output in positive response of y ... then pls at least run one time both the code , specially the c code
6th Jun 2021, 2:33 AM
just commedy
just commedy - avatar