2 views

Uploaded by sumit67

C programming practice

- Summer Math
- Topical Test Chapter 1 Paper 1
- Arithmetic Sequence
- Mathematics Sequence Series MCQ
- 01 Sample Programs c++
- Exponential Noise & All Filters(Matlab Code)
- Ed Helper
- Connecting Mathematical Ideas Introduction
- j Met 2010 Analysis
- rrc
- The Knowledge of Science is Incomplete in The
- NTS Book for GAT General Free Download
- 1_sc
- 2.pptx
- Math 5 Second Quarter Examination 2016-2017
- College-Mathematics-9th-Edition-Cleaves-Solutions-Manual.pdf
- math MC
- Lesson 19th - Maths
- 1st Periodical Math 8
- Program Mid 2013

You are on page 1of 4

main( )

{ int x;

for (x=0;x<100;x++) The given program prints numbers

if (((x>50) && (x<70)) || (x%2==0)) between 0 and 100, which are either even

printf("%d ",x); or between 50 and 70.

}

main( )

{ int x; The given program prints

for (x=0;x<100;x++) numbers which are

if (((x>20)&&(x<70))&& !((x>40)&&(x<60))) between 20 and 70 but not

printf("%d ",x); between 40 and 60.

}

1. Write a program, which prints all even numbers between 20 and 70.

2. Write program, which prints all numbers between 20 and 40, and all even numbers

between 50 and 80.

3. Write program, which will print all even numbers less then 50 and all odd numbers

more than 50.

4. Write program, which prints all even numbers between 20 and 40, and all odd

numbers between 50 and 80.

5. Write program, which will print all numbers which are multiple of either 3 or 7.

6. Write program, which will print all numbers which are either between 50 and 70, or

less than 20, or more than 90.

7. Write program, which will print all numbers, which are even but not a multiple of

either 3 or 5. e.g. 2 4 8 14 16 22 .

8. Write program, which will print all numbers, which are either a multiple of 3 or 5 but

not both.

9. Write program, which will print those numbers whose last digit is multiple of 3. e.g. 0,

3, 6, 9, 10, 13, 16, 19, 20, 23, ..

10. Write program, which will print those numbers whose last digit is between 5 and 8.

e.g. 5, 6, 7, 8, 15, 16, 17, 18, 25, 26, .

11. Write program, which will print those numbers whose sum of both digits is multiple of

7. e.g. 0,7,16, 25, 34, 43, 52, 59, 61, ..

12. Write program, which will print those numbers whose first digit leaves remainder 1

when divided by 3. e.g. 10, 11, ..., 19,40, 41, , 49, 70, 71, ..., 79.

13. Write program, which will print all numbers between 0 and 9, 20 and 29, 40 and 49,

, 80 and 89. [Hint: check condition ((x/10)%2) == 0].

14. Write program, which will print all odd numbers between 0 and 9, 20 and 29, 40 and

49, , 80 and 89 and all even numbers between 10 and 19, 30 and 39, , 90 and 99.

#include<stdio.h> The program outputs

main() ******OOOOO*********

{ int x,y; *****OOOOOO*********

for (y=0;y<10;y++) ****OOOOOOO*********

***OOOOOOOO*********

{ for (x=0;x<20;x++)

**OOOOOOOOO*********

if ((x+y<6) || ((x>10) && (y<8))) *OOOOOOOOOO*********

printf("*"); OOOOOOOOOOO*********

else printf("O"); OOOOOOOOOOO*********

printf("\n"); OOOOOOOOOOOOOOOOOOOO

} OOOOOOOOOOOOOOOOOOOO

}

Write programs for each of Picture 4

followings by modifying the OOOOOOOOOOOOOOOOOOOOOOOOOOOOOO

*OO*O**OO**O*OO*OO*O**OO**O*OO

line containing for and if OOOOOOOOOOOOOOOOOOOOOOOOOOOOOO

only. *OO*O**OO**O*OO*OO*O**OO**O*OO

Picture 1 OOOOOOOOOOOOOOOOOOOOOOOOOOOOOO

******************** *OO*O**OO**O*OO*OO*O**OO**O*OO

*O*O*O*O*O*O*O*O*O*O OOOOOOOOOOOOOOOOOOOOOOOOOOOOOO

******************** *OO*O**OO**O*OO*OO*O**OO**O*OO

*O*O*O*O*O*O*O*O*O*O OOOOOOOOOOOOOOOOOOOOOOOOOOOOOO

******************** *OO*O**OO**O*OO*OO*O**OO**O*OO

*O*O*O*O*O*O*O*O*O*O

Picture 5

********************

OOOOOO*****OOOOOOOOO

*O*O*O*O*O*O*O*O*O*O

OOOOO******OOOOOOOOO

********************

OOOO*******OOOOOOOOO

*O*O*O*O*O*O*O*O*O*O

OOO********OOOOOOOOO

OO*********OOOOOOOOO

Picture 2

O**********OOOOOOOOO

OOOOOOOO************

***********OOOOOOOOO

OOOOOOOO************

***********OOOOOOOOO

OOOOOOOO************

********************

********************

********************

********************

********************

Picture 6

********************

OOOOOOOOOOOOOOO

***************OOOOO

OO*O*O*O*O*O*O*

***************OOOOO

O*OOOOOOOOOOOOO

***************OOOOO

OOOO*O*O*O*O*O*

O*O*OOOOOOOOOOO

Picture 3

OOOOOO*O*O*O*O*

O*O*O*O*O*

O*O*O*OOOOOOOOO

*O*O*O*O*O

OOOOOOOO*O*O*O*

O*O*O*O*O*

O*O*O*O*OOOOOOO

*O*O*O*O*O

OOOOOOOOOO*O*O*

O*O*O*O*O*

*O*O*O*O*O

O*O*O*O*O*

*O*O*O*O*O

O*O*O*O*O*

Picture 7

******************** Picture 11

OOOOOOOOOOOOOOOOOOOO ********************

******************** *OOOO*OOOO*OOOO*OOOO

OOOOOOOOOOOOOOOOOOOO ********************

******************** *OOOO*OOOO*OOOO*OOOO

OOOO**********OOOOOO ********************

******************** *OOOO*OOOO*OOOO*OOOO

OOOO**********OOOOOO ********************

******************** *OOOO*OOOO*OOOO*OOOO

OOOO**********OOOOOO ********************

*OOOO*OOOO*OOOO*OOOO

Picture 8 Picture 12

OOOOOOOOOOOOOOOOO O****O****O****O****

OOOOOO*****OOOOOO *OOOO*OOOO*OOOO*OOOO

OOOO*********OOOO O****O****O****O****

OOO***********OOO *OOOO*OOOO*OOOO*OOOO

OO*************OO O****O****O****O****

OO*************OO *OOOO*OOOO*OOOO*OOOO

OO*************OO O****O****O****O****

OOO***********OOO *OOOO*OOOO*OOOO*OOOO

OOOO*********OOOO O****O****O****O****

OOOOOO*****OOOOOO *OOOO*OOOO*OOOO*OOOO

OOOOOOOOOOOOOOOOO

Picture 13

Picture 9 OO*O*O*O*O*O*O*

******************** OO*O*O*O*O*O*O*

******************** **OO*O*O*O*O*O*

******************** OOOO*O*O*O*O*O*

*****OO************* ****OO*O*O*O*O*

****OOOO************ OOOOOO*O*O*O*O*

***OOOOOO*********** ******OO*O*O*O*

**OOOOOOOO********** OOOOOOOO*O*O*O*

*OOOOOOOOOO********* ********OO*O*O*

OOOOOOOOOOOO******** OOOOOOOOOO*O*O*

OOOOOOOOOOOOO*******

Picture 10

********************

********************

******OO************

*****OOOOO**********

****OOOOOOOO********

***OOOOOOOOOOO******

**OOOOOOOOOOOOOO****

*OOOOOOOOOOOOOOOOO**

OOOOOOOOOOOOOOOOOOOO

OOOOOOOOOOOOOOOOOOOO

- Summer MathUploaded bybobbob698
- Topical Test Chapter 1 Paper 1Uploaded bysyukrie3
- Arithmetic SequenceUploaded byyeunu117
- Mathematics Sequence Series MCQUploaded bykeerthy
- 01 Sample Programs c++Uploaded byPradyumnaBhat
- Exponential Noise & All Filters(Matlab Code)Uploaded bySharath Kumar N
- Ed HelperUploaded bydsgjtn
- Connecting Mathematical Ideas IntroductionUploaded byhafaba
- j Met 2010 AnalysisUploaded byThahir Nm
- rrcUploaded byapi-353368377
- The Knowledge of Science is Incomplete in TheUploaded bySheetal Giri
- NTS Book for GAT General Free DownloadUploaded byMuhammad Ahsan Ali Kharal
- 1_scUploaded byBhabani Sankar Dehury
- 2.pptxUploaded byJean Cuarisma
- Math 5 Second Quarter Examination 2016-2017Uploaded byMariavonzed Opalla
- College-Mathematics-9th-Edition-Cleaves-Solutions-Manual.pdfUploaded bya443563099
- math MCUploaded byHazen B. Rayos
- Lesson 19th - MathsUploaded byKreizi Blaek
- 1st Periodical Math 8Uploaded byCjay Maningas
- Program Mid 2013Uploaded bynihadc
- Maths for Computer SciUploaded byManoj Sharma
- Math Week Sponsorship Letter.docx.docxUploaded byRhoxette Pedroza
- Constructing a Circle GraphUploaded byRonaldo Yabut
- Mathematics Objective Questions Part 9Uploaded byhadhai
- 5indices-130125040417-phpapp01Uploaded bybigbr185
- Ateneo Appeal Letter 2Uploaded byJericho Ventanilla
- family letter 18Uploaded byapi-258403337
- NUMBERS AND TELLING TIMES.pptxUploaded byNirwanhy Makmur
- Family FeudUploaded byLý Phối Hân
- 400puzzles Problem SetUploaded byHaroon Ghani

- PHP 01 IntroUploaded bysumit67
- Ch XUploaded bysumit67
- Test Class IXUploaded bysumit67
- Public Complaints 8 a Pr 2016Uploaded bysumit67
- html - MDNUploaded bysumit67
- Ntse SyllabusUploaded bysumit67
- Vacancy ITUploaded bysumit67
- Areas of CirclesUploaded bysumit67
- MathQuestionPaper2015.pdfUploaded bysumit67
- IntroducingASP.netUploaded bysumit67
- Mock Test PaperUploaded bysumit67
- KVS-PGT-SYLLABUS.pdfUploaded byMondar Deb
- Common TermsUploaded bysumit67
- FunctionsUploaded bysumit67
- Basic ElementsUploaded bysumit67
- StatementsUploaded bysumit67
- Statements and Flow ControlUploaded bysumit67
- CNS - IntroductionUploaded bysumit67
- Real NumbersUploaded bysumit67
- Quadratic EquationsUploaded bysumit67
- NTSE Sample Papers for Class 10 - Stage I - MATUploaded byaglasem
- 2007p1.pdfUploaded bysumit67
- NTSE Stage 1 State Level Model Paper 1Uploaded bysumit67
- Math Question Paper SA2-2012 UnpwUploaded bysumit67
- JEE 2017 Information BulletinUploaded bydhirajkumar_1
- 2017 10 Math Sample Paper Sa2 Solved 01 Ques UnpwUploaded bysumit67
- Classes & ObjectsUploaded bysumit67

- Phuong Trinh Dai SoUploaded bytranbahuy
- DomainUploaded byKb Ashish
- English-Portuguese Flash Cards - 100 VerbsUploaded byMarinaAparecida
- QPMATHSX-CH1Uploaded byAnonymous EafYD0
- HCF&LCMUploaded bykomalahluwalia
- Amicable NumbersUploaded byPedro A. Marrone G
- Pg91 Restore ErrorsUploaded byshreeseva
- Important FormulasUploaded bygshagsree
- Lab1Uploaded bykronoscar
- TS-1-Number systems.pdfUploaded byUdai Kumar
- Maths Solutions05Uploaded byabhishek0909
- 16_shailesh_adventuresproblemsolving.pdfUploaded byParth Shah
- Les Gets World Cup XC 2019 - Elite Women ResultsUploaded byPinkbike
- Lecture2.pdfUploaded bySon T. Nguyen
- Geometric NumbersUploaded byjmertes
- What's Special About This NumberUploaded byimmyself
- Algebra Capitulo 02Uploaded byJauj
- e GMAT Number PropertiesUploaded byShyam Kishore
- Latihan Aljabar SantosUploaded byrahma
- Amicable Numbers and Aliquot SequencesUploaded byJuliaHorwitz
- Articulo E241de Leonhar EulerUploaded byEduardoSeverson
- MATH 6 - Q1WK7- DAY 2Uploaded byJeffrey C. Flores
- Fastrack Objective Mathematics - By EasyEngineering.net.pdfUploaded bypopa
- chapter 1Uploaded byNor Hamidah Anum
- Concept of DecimalUploaded byFaiz Wahid
- Permutable primeUploaded byВук Дражић
- 2204919-Integer-NotesUploaded byHearty Ceeda
- 06) Introductory IntegerUploaded bySalmanShah
- The fafUploaded byTrushit Vaishnav
- Number Theory AssignmentUploaded byMiliyon Tilahun