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

hi sir c progarm codeing how to write sir........
take any C book then u can learn more...
Suryateja
What is the actual size of INT in the C language, 2 or 4 bytes?
The actual size to int is determined by the compiler as the program runs. But theoretically the size is 2 bytes. You can increase the size by adding keyword long infront of it to make the size 4 bytes. Eg int a; // 2 bytes Long int b; // 4 bytes
Kunal
What is = and == in C language?
= is assignment operator while ==is comparision operator
Sayed
0 0
6
How do I start learning C programming and finish it in one month?
Please follow the book "C Programming" by Detal & Detal. Its an applied book easy to understand compare to others. U may also learn through online free tutorial.
Pallavi
0 0
8
What is the output of the below: printf("%d", printf("Hello"));
The output would be as follows: Hello5 Reason: 'printf( )' not only prints a given strings, but it also returns a number which is the count of the number of characters that it has successfully printed...
Pravalika

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

Ask a Question

Related Lessons

Basics Of C And C++
C++ is powerful, highly flexible, and adaptable programming language that allows software engineers to organise and process information quickly and effectively. But this high-level language is relatively...

Dynamic Memory Allocation in C using malloc()
#include <stdio.h>#include <conio.h>//#include <malloc.h> OR#include <stdlib.h>void main(){ int *ptr, i, n, sum = 0; printf("how many elements ? "); scanf("%d", &n);...

C for Begginers
C is an procedure oriented programming language. For any begginer the word program is new. Program: Set of instructions to be followed by machine or computer. Instruction Examples: Arithmetic instruction...

Understanding Computer Science Concepts with Images and Videos..
All Computer science concepts relating to programming and software development are only virtual. It cannot be practically shown as a hardware parts of a computer. But for better understanding it should...

Pro learners tip for C language
First get the concept of algorithm before heading to write your first program.

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