481 Views

1 11 111 1111 write a programm in c


Hyper Rdx 1st Mar, 2021
Answer (1)
Abhishek Roy 1st Mar, 2021

In Python, the code is pretty easy and a single line one on Jupyter Platform.

As far as C is concerned, the algorithm goes somewhat like this. You need a Do While Loop

With the Function

k=0;

do

{

z=10*k+1

k=z

print z

}

while (z<=1111)

I guess this will work. Of course you may use While Loop or For Loop Instead. I believe use the appropriate Print function with /d for printing in different line.


Related Questions

Amity University-Noida B.Tech...
Apply
Among top 100 Universities Globally in the Times Higher Education (THE) Interdisciplinary Science Rankings 2026
Amity University-Noida M.Tech...
Apply
Among top 100 Universities Globally in the Times Higher Education (THE) Interdisciplinary Science Rankings 2026
Amity University-Noida MBA Ad...
Apply
Ranked among top 10 B-Schools in India by multiple publications | Top Recruiters-Google, MicKinsey, Amazon, BCG & many more.
Amity University-Noida BBA Ad...
Apply
Among top 100 Universities Globally in the Times Higher Education (THE) Interdisciplinary Science Rankings 2026
RV University, Mysuru | B.Tec...
Apply
World-class and highly qualified engineering faculty. High-quality global education at an affordable cost
New Horizon College BBA Admis...
Apply
UG Admissions 2026 open| NAAC ‘A’ grade | Merit-based Scholarships available.
View All Application Forms

Download the Careers360 App on your Android phone

Regular exam updates, QnA, Predictors, College Applications & E-books now on your Mobile

150M+ Students
30,000+ Colleges
500+ Exams
1500+ E-books