filmov
tv
Write a short program to print the following series :1 4 7 10 …40 1 -4 7 -10 ………….. -40

Показать описание
Sumita Arora Class 11 computer science chapter conditional and iterative statement type C Q 9||
Website Link :-
Q. Write a short program to print the following series:
(i) 1 4 7 10 ………. 40
(ii) 1 -4 7 -10 ………….. -40
Answer :-
(i)
for i in range(1,41,3):
print(i,end=" , ")
(ii)
for i in range(1,41,3):
if i % 2 == 0 :
print(-i,end=" , ")
else :
print(i,end=" , ")
Output :-
(i)
1 , 4 , 7 , 10 , 13 , 16 , 19 , 22 , 25 , 28 , 31 , 34 , 37 , 40 ,
(ii)
1 , -4 , 7 , -10 , 13 , -16 , 19 , -22 , 25 , -28 , 31 , -34 , 37 , -40 ,
Website Link :-
Q. Write a short program to print the following series:
(i) 1 4 7 10 ………. 40
(ii) 1 -4 7 -10 ………….. -40
Answer :-
(i)
for i in range(1,41,3):
print(i,end=" , ")
(ii)
for i in range(1,41,3):
if i % 2 == 0 :
print(-i,end=" , ")
else :
print(i,end=" , ")
Output :-
(i)
1 , 4 , 7 , 10 , 13 , 16 , 19 , 22 , 25 , 28 , 31 , 34 , 37 , 40 ,
(ii)
1 , -4 , 7 , -10 , 13 , -16 , 19 , -22 , 25 , -28 , 31 , -34 , 37 , -40 ,
Write a short program to input a digit(1 -10) and print it in words.
Write a short program to find largest number of the list of number entered through keyboard.
Write a short program to print first n odd number in descending.
Write a short program to find average of list of number entered through keyboard.
Write a short program to check weather square root of a number is prime or not.
Write a short program to print the following series :1 4 7 10 …40 1 -4 7 -10 ………….. -40
write a python program to print tables | python programming short video #trendingshorts #table
Write a short program to print first n odd numbers in descending order | Python | CBSE Class 11
Write a short python code segment that print the longest word in the list of the word.
Write a short program that asks for your height in centimeter and then converts your height in feet
Write a short program to check whether square root of a number is prime or not | Python | Class 11
How to Write Code In Visual Code Studio🤔? - #shorts #short
Write a short program to find average of list of numbers entered through keyboard | Python Class 11
write a program to lcm of two numbers in c #short
write a program to print i love you!#short #youtube #youtubeshorts #viral #viralshorts #viralvideo
write a program add to number #short #coding #viral #computer #bca
Teacher : Write Sorry 100 Time Normal People VS Programmers #short || Normal People vs Programmer😎...
write a c program to print the puls star pattern (+)|#shorts|#short|#shortvideo
Write a program to print \n in c?#short #youtube #viral
write a program to check add or even number?#short #viral
Write a program to convert km into m #coding #short
write a program to check divided 2 and 3 in c?#short #youtube #viral
write a program to print table of users choice #short in c language
write a c program to find largest element in an array #short
Комментарии