- 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; }
6 odpowiedzi
+ 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 .
+ 1
If ch = 'y' then the cycle will be infinite.
0
Looking at your profile, you have completed enough C course to do this on your own.
What's the difficulty then ?
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
0
You are wrong, these codes work exactly the same.
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