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

What are pointers in C language?
Hi Imran, Hope you are doing good. Are you looking for short answer or long answer? :) Pointers in C are variables that store memory addresses. They point to the location of another variable, allowing...
Imran
0 0
7
Does a civil engineer need to learn the C language?
C language is a common subject in the first year of engineering irrespective of the branch. It may not be helpful for your civil engineering career but you definitely need to pass for B.Tech graduation.
Sandeep
0 0
5
Basics of 'C'language
C is middle level language, using C you can write program which directly interact with the hardware like device driver programming or you can write GUI application. C is very powerful language compare...
Raghavendra
What is "&" called in C language?
In the C programming language, the "&" symbol is called the "address-of" operator. It is used to obtain the memory address of a variable. When you use "&" followed by a variable name, it provides...
Soumya
0 0
5

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

Ask a Question

Related Lessons

Memory Layout of C Programs
A typical memory representation of C program consists of following sections. Text Segment: A text segment, also known as a code segment or simply as text, is one of the sections of a program in an object...

All About Programming And A Good Programmer.
Hi, This is my first lesson for you guys. Hope you enjoy reading it. In recent community questions, I found many people wanted to be good programmers, or wanted to have good hands on certain language,...

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...

Everything about printf in C language
What is printf and from where it comes from in C code.? You must have used printf so many times in your Car programs but do you really know everything about printf? Let's see. What is the full form...

C PROGRAM FOR GENERATING SOUND
#include<stdio.h> #include<conio.h> #include<dos.h> void main() { sound(3000); // sound function have single parameter , this parameter we put integer value its generating...

V. Muthu Ganeshan

0 0
0

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