+ 7

what is output

#include<stdio.h> #include<conio.h> void main() { int i,j; clrscr(); for(i=0;i<=5;i++) { for(j=0;j<=5;j++) { printf("%d",i); } printf("\n"); } getch(); }

3rd Aug 2018, 8:13 AM
Shubham goyal
Shubham goyal - avatar
4 Respuestas
+ 12
000000 111111 222222 333333 444444 555555 Also you can try this code on playground and see the results. Hope this helps☺️☺️.
3rd Aug 2018, 8:29 AM
Meet Mehta
Meet Mehta - avatar
+ 4
You should use int main() instead of void main() http://www.stroustrup.com/bs_faq2.html#void-main
3rd Aug 2018, 11:38 AM
A Fox
A Fox - avatar
+ 3
The simplest way is to use a stringstream: #include<iostream> #include<string> #include<sstream> using namespace std; string itos(int i) // convert int to string { stringstream s; s << i; return s.str(); } int main() { int i = 127; string ss = itos(i); const char* p = ss.c_str(); cout << ss << " " << p << "\n"; }
5th Aug 2018, 2:23 AM
Ankit Roy
Ankit Roy - avatar
0
is it even right?
3rd Aug 2018, 3:56 PM
Ubeid
Ubeid - avatar