- 2
Challenge for all..Print "Hello World" Program without using "cout" object,but it should print "Hello world"Statement.👍
challenge......👍🙅
13 Answers
+ 4
#include <iostream>
using namespace std;
int main() {
//two ways
clog<<"hello\n";
cerr<<"world";
return 0;
}
+ 4
maybe like this,
ostream obj (std::cout);
obj <<"hello world";
In this directly I am not using the cout but whereas I am using memory of cout. Added the sample code in my code playground. If you want check it.
Hope this is what you're looking for
+ 2
hey brother....u must know that......printf and cout is the one and the same things😂 just difference is language ok! so u should have to write without any "cout" and "printf"..........on dare to solve this...👍👍
+ 2
Tx @av editor👌
+ 1
just include the <stdio.h>
just like marco did
+ 1
#include<stdio.h>
int main(){
puts("hello world");
return 0;
}
+ 1
hey brother Marco Linde you are absolutely coreect...bczss u r not used any type of cout obj....u jaust used the obj of ostream cerr......that i expected...its nyc answer...👍👍👍
+ 1
brother Marco Linde just delete your comment from this answer......beacause someone see that and copy to answer this question.....👍ok brother
+ 1
Actually tukasz answer is also right. He didn't use printf, cout statements right.
0
Is this supposed to be a challenge, or what?
0
ya should be supposed to be challenge brother...👤👍
0
noooo its not like micro...just different logic!!!
0
venkatesh(venki) brother u are also correct but r using cout,i know you are refering there address but this answer was not expected to me...in any how you should not to be used "cout"...either address nor object....without cout...i dont wanna see "cout" word in program....👍