UrbanPro

Learn C Language from the Best Tutors

  • Affordable fees
  • 1-1 or Group class
  • Flexible Timings
  • Verified Tutors

Search in

How to write a C program to print the series 1,9,17, 33,49,73,97?

Asked by Last Modified  

Follow 2
Answer

Please enter your answer

iOS Trainer and Developer, C++, Advanced C++, C, Core Java Trainer

The series is like adding 8 * x for two numbers and then incrementing x by 1 so that 8 is doubled. 1, (1+8*1) 9, (9+8*1) 17, (17+ 8 * 2) 33, (33 + 8 * 2) 49 and so on. So it will be like: int main() { // Series to print: 1,9,17, 33,49,73,97..... int multiplier = 8; int...
read more
The series is like adding 8 * x for two numbers and then incrementing x by 1 so that 8 is doubled. 1, (1+8*1) 9, (9+8*1) 17, (17+ 8 * 2) 33, (33 + 8 * 2) 49 and so on. So it will be like: int main() { // Series to print: 1,9,17, 33,49,73,97..... int multiplier = 8; int reset = 0; int seriesNumber = 1; int limit = 0; printf("Print the limit of series = "); scanf("%d",&limit); printf("%d",seriesNumber); for(int i=1;i= 2) { multiplier += 8; reset = 1; } else { reset++; } seriesNumber += multiplier; printf(", %d",seriesNumber); } return 0; } I am sure the code can be improved too. Output is attached. read less
Comments

Full Stack Developer

1, (1+8*1) 9, (9+8*1) 17, (17+ 8 * 2) 33, (33 + 8 * 2) 49 and so on.
Comments

Full Stack Developer

#include "stdio.h" int main(void) { int i=0,j=1, sum=1; while(sum lessthan 200){ i++; printf("%d\n",sum); sum = sum + (8*j); if(i == 2){ i=0; j=j+1; } } return 0; } Please use lessthan symbol in loop condition as this input does not accepts html tag symbols.
Comments

View 1 more Answers

Related Questions

Is it good practicing c++ in code blocks instead of turbo c++?
Practicing/working on Turbo C++ is always good..because its hard to do comparatively 'code blocks'. seems 'code blocks' has been designed by considering the latest working tools(like Visual Studio from...
Santosh
What is the cost of the course?What kind of questions are asked for interviews from C language??
Course fee depends on the depth of the course. Interview question are mainly from DS(Data Structure) importantly linked list, BST tree,array and except this pointer, string, function and recursion is important.
Chandana
How and where do I start learning C programming?
C language is the basic of the programming to learn the basic of programming we learn the c language
Gaurav
0 0
7
Why is C programming language called C?
The C programming language is named "C" because it is a successor to the B programming language. The B language was developed at Bell Labs by Ken Thompson and Dennis Ritchie. When they created C, they...
Ashwini
0 0
6
Which is the best software for working with C language?
Choosing the best software for C programming often depends on personal preference, but popular options include GCC (GNU Compiler Collection), Visual Studio, and CLion. Consider factors like your platform,...
Kiran
0 0
6

Now ask question in any of the 1000+ Categories, and get Answers from Tutors and Trainers on UrbanPro.com

Ask a Question

Related Lessons

PRACTISE makes you PERFECT ; ; ; There is no SUBSTITUTE for HARD WORK ;;;;Breathe SUCCESS like OXYGEN
Proper Planning ( reg what portions to be covered today) revising today's class portions & clarifying doubts solving Maths problems regularly ,noting down formulae separately trying to understand...

C Program to print Block Letter and Small Case Alphabets using C
/* WAP to print Block Letter and Small Case Alpahbets using C*/ //Hint:use ascii code(value) to print #include#include void main(){ int i; clrscr(); //Block Letters Alphabets printf("Block Letters Alphabets\n");...

Pointers Concept
Every variable has a memory location and every memory location has its address defined which can be accessed using ampersand (&) operator, which denotes an address in memory. Consider the following...

Internet of Things, Social Media Becoming Part of E-Discovery Landscape
The days when e-discovery consisted of handing over copies of e-mails to address Freedom of Information Act (FOIA) requests, compliance regulations or other legal obligations are over. Now, it's just as...

Recommended Articles

Brilliant Academy is one of the reputed institutes for B.Tech tuition classes. This institute is specialised in delivering quality tuition classes for B.E, Engineering - all streams and Engineering diploma courses. Incorporated in 2012, Brillant Academy is a brainchild of Mr Jagadeesh. The main motto of the academy is to...

Read full article >

Lasya Infotech is a Hyderabad based IT training institute founded in 2016 by O Venkat. Believing in his innovation, passion and persistence and with a diverse blend of experience, he started his brainchild to deliver exemplary professional courses to aspiring candidates by honing their skills. Ever since the institute envisions...

Read full article >

Software Development has been one of the most popular career trends since years. The reason behind this is the fact that software are being used almost everywhere today.  In all of our lives, from the morning’s alarm clock to the coffee maker, car, mobile phone, computer, ATM and in almost everything we use in our daily...

Read full article >

Almost all of us, inside the pocket, bag or on the table have a mobile phone, out of which 90% of us have a smartphone. The technology is advancing rapidly. When it comes to mobile phones, people today want much more than just making phone calls and playing games on the go. People now want instant access to all their business...

Read full article >

Looking for C Language Classes?

Learn from the Best Tutors on UrbanPro

Are you a Tutor or Training Institute?

Join UrbanPro Today to find students near you
X

Looking for C Language Classes?

The best tutors for C Language Classes are on UrbanPro

  • Select the best Tutor
  • Book & Attend a Free Demo
  • Pay and start Learning

Learn C Language with the Best Tutors

The best Tutors for C Language Classes are on UrbanPro

This website uses cookies

We use cookies to improve user experience. Choose what cookies you allow us to use. You can read more about our Cookie Policy in our Privacy Policy

Accept All
Decline All

UrbanPro.com is India's largest network of most trusted tutors and institutes. Over 55 lakh students rely on UrbanPro.com, to fulfill their learning requirements across 1,000+ categories. Using UrbanPro.com, parents, and students can compare multiple Tutors and Institutes and choose the one that best suits their requirements. More than 7.5 lakh verified Tutors and Institutes are helping millions of students every day and growing their tutoring business on UrbanPro.com. Whether you are looking for a tutor to learn mathematics, a German language trainer to brush up your German language skills or an institute to upgrade your IT skills, we have got the best selection of Tutors and Training Institutes for you. Read more