SlideShare a Scribd company logo
DIT Past Papers
Paper: Computer Programming
Compiled By: Engr. Jamal khan
Paper: 2012
Q.1:-State the structure of a C / C++ program.
Q.2:-What are C/C++ data types?
Explain the following data types also write how they are declared.
i) Boolean type
ii) Character type
iii) Integer type
Q.3:-a)What do you mean by character constant? Give one example.
b)What is 3 string constant? Explain with the help of one example.
Q.4:-a)Define and explain Variable.
b)Write the rules for constructing variable names.
Q.5:-Write the purpose of the following functions in one line.
a) get ( ) function
b) put ( ) function
c) getch ( ) function
d) putch ( ) function
e) gets ( ) function
Q.6: -State about output using cout and input using cin by giving one example.
Q.7: – a) What is a Do-While loop. Explain with the help of an example.
b) What is a break statement? Give one example.
Q.8:- a) What does relational operator do, list its different types.
b) Write a C++ program to print first ten numbers.
Paper 2013:
Q.1:- Differentiate the following terms with suitable examples.
1. Variable Declaration and Variable Definition.
2. Identifier, Constant and Variable
3. Operands, Operators and Expression
Q.2:- What will be the output of the following program segment. Explain the output.
main ()
{
int a=2, b=3, x, y;
float w, z;
x= a/b * b;
y = b/a * a;
w = a/b *b;
z = b/a * a;
printf( “%d%d %f %f *, a.b,w,z);
}
Q.3:- a) What is decision control structure ? Explain the if statement and if-else statement with
the help of an example.
b) Explain Break statement with example.
Q.4:-Write a program which find and Print the largest of three numbers by using nested IF
statement.
Q5:- a)What is loop? Explain For Loop with the help of an example.
b) What will be the output of the following program segment.
main ( )
{
int i;
For (i=l;i <=5; printf (“ln%d”, i))
i++;
}
Q.6:- a) What is Preprocessor Directive? Why we use # include Preprocessor Directive in the
start of program?
b) What is Header file? Give some examples of Header files are used in C/C++ Language.
Q.7:-Explain the following operators with the help of an example.
a) Compound Assignment Operators.
b) Increment & Decrement Operators.
c) Conditional Operator.
Q.8:-Differentiate the following built-in functions.
a) Printf () and Scanf ()
b) geleh () and Putch ()
c) Puts () and gels ()
d) Strlen () and Strlwr ()
e) Pow () and Sqrt ()
Paper : 2014
Q1:- Differentiate any five pairs from given.
i) Signed and unsigned integer
ii) STRLWR () and STRUPRO)
iii) Break and continue statement
iv) Prefix and postfix operator
v) execution time value assignment and run time value assignment
Q2: Write short notes on any two from the following with example
1) for loop
2) processor directive
3) arithmetic functions
Q3: Write body structure for any five from the given
i) NESTOD if-else statement
ii) while loop
iii) GOTO statement
iv) declaration of user defined function
v) print
vi) C/C++ program structure
Q4: Write output for any four from given logics.
i) int a=5, b=10;
printf(=b%a5%d/n”, b%a);
ii) int n= 10
char=”*”
printf(“%d”,ch)
printf (%c”,chi);
iii) int I,j ;
for (i=1;i<5;i++)
for(j=1;j<= 1,391)
Printf(“*”);
Printf (“n”)
iv) printf(“%f’, ceil(9.9);
v) printf(“%”, pow (5,2));
Part-B
Q5: Write program that take a numb3er from user and show whether it is odd or even using if-
else statement
Q6: Elaborate while and do while loop in detail with one example.
Q7: Elaborate user defined words and reserve words with examples
Q8: Elaborate input and output statements. Also write down two functions of each statement.
Paper : 2015
Q1:- Differentiate any five pairs from given.
i) Signed and unsigned integer
ii) STRLWR () and STRUPRO)
iii) Break and continue statement
iv) Prefix and postfix operator
v) execution time value assignment and run time value assignment
Q2: Write short notes on any two from the following with example
1) for loop
2) processor directive
3) arithmetic functions
Q3: Write body structure for any five from the given
i) NESTOD if-else statement
ii) while loop
iii) GOTO statement
iv) declaration of user defined function
v) print
vi) C/C++ program structure
Q4: Write output for any four from given logics.
i) int a=5, b=10;
printf(=b%a5%d/n”, b%a);
ii) int n= 10
char=”*”
printf(“%d”,ch)
printf (%c”,chi);
iii) int I,j ;
for (i=1;i<5;i++)
for(j=1;j<= 1,391)
Printf(“*”);
Printf (“n”)
iv) printf(“%f’, ceil(9.9);
v) printf(“%”, pow (5,2));
Part-B
Q5: Write program that take a numb3er from user and show whether it is odd or even using if-
else statement
Q6: Elaborate while and do while loop in detail with one example.
Q7: Elaborate user defined words and reserve words with examples
Q8: Elaborate input and output statements. Also write down two functions of each statement.
Paper : 2019
Q1. Explain C is considered to be a remarkable and powerful tool for programming. Also
elaborate on the benefits of object-oriented programming.
Q2. What are reserved words? Explain its usage with the help of programing example.
Q3. Write a C program to print first ten natural number from 10 to 1 in descending order starting
from 10, Using decrement operator without using loop.
Q4. Write a program to print size of int, flout, double, char and bool data types on separate line
using print function.
Q5. Write a program to assign five different numbers to integer variables without appearing the
entered number on the screen (Hint: use getch function)
Q6. Wat are relational operators? Write a C Program to check if an entered number is divisible
by 4 and 6 using nested if statement.
Q7. What is the condition which leads to the use of continue statement in loops? Support your
answer with a C programming example.
Q8. What are library function? Write a C program to solve = √[(x2+y2) using sqrt () function let
x=3 and y=4
Ad

More Related Content

What's hot (20)

Python functions
Python functionsPython functions
Python functions
Prof. Dr. K. Adisesha
 
Vi editor in linux
Vi editor in linuxVi editor in linux
Vi editor in linux
Bhumivaghasiya
 
Python for loop
Python for loopPython for loop
Python for loop
Aishwarya Deshmukh
 
Programming Fundamental Presentation
Programming Fundamental PresentationProgramming Fundamental Presentation
Programming Fundamental Presentation
fazli khaliq
 
Virtual Machine Concept
Virtual Machine ConceptVirtual Machine Concept
Virtual Machine Concept
fatimaanique1
 
Arrays in Java | Edureka
Arrays in Java | EdurekaArrays in Java | Edureka
Arrays in Java | Edureka
Edureka!
 
Nested loops
Nested loopsNested loops
Nested loops
Adnan Ferdous Ahmed
 
Architecture of Linux
 Architecture of Linux Architecture of Linux
Architecture of Linux
SHUBHA CHATURVEDI
 
Presentation on Programming Languages.
Presentation on Programming Languages.Presentation on Programming Languages.
Presentation on Programming Languages.
Mohammad Shakirul islam
 
OOP interview questions & answers.
OOP interview questions & answers.OOP interview questions & answers.
OOP interview questions & answers.
Questpond
 
OOP in C++
OOP in C++OOP in C++
OOP in C++
ppd1961
 
Python Introduction
Python IntroductionPython Introduction
Python Introduction
Punithavel Ramani
 
Vantagens e desvantagens de uma arquitetura microservices
Vantagens e desvantagens de uma arquitetura microservicesVantagens e desvantagens de uma arquitetura microservices
Vantagens e desvantagens de uma arquitetura microservices
Fábio Rosato
 
OOPS IN C++
OOPS IN C++OOPS IN C++
OOPS IN C++
Amritsinghmehra
 
GE3151 PSPP _Unit 1 notes and Question bank.pdf
GE3151 PSPP _Unit 1 notes and Question bank.pdfGE3151 PSPP _Unit 1 notes and Question bank.pdf
GE3151 PSPP _Unit 1 notes and Question bank.pdf
Guru Nanak Technical Institutions
 
Basic Python Programming: Part 01 and Part 02
Basic Python Programming: Part 01 and Part 02Basic Python Programming: Part 01 and Part 02
Basic Python Programming: Part 01 and Part 02
Fariz Darari
 
Introduction to the basics of Python programming (part 1)
Introduction to the basics of Python programming (part 1)Introduction to the basics of Python programming (part 1)
Introduction to the basics of Python programming (part 1)
Pedro Rodrigues
 
Python Tutorial Part 1
Python Tutorial Part 1Python Tutorial Part 1
Python Tutorial Part 1
Haitham El-Ghareeb
 
introduction to programming languages
introduction to programming languagesintroduction to programming languages
introduction to programming languages
NaqashAhmad14
 
Macro and Preprocessor in c programming
 Macro and  Preprocessor in c programming Macro and  Preprocessor in c programming
Macro and Preprocessor in c programming
ProfSonaliGholveDoif
 
Programming Fundamental Presentation
Programming Fundamental PresentationProgramming Fundamental Presentation
Programming Fundamental Presentation
fazli khaliq
 
Virtual Machine Concept
Virtual Machine ConceptVirtual Machine Concept
Virtual Machine Concept
fatimaanique1
 
Arrays in Java | Edureka
Arrays in Java | EdurekaArrays in Java | Edureka
Arrays in Java | Edureka
Edureka!
 
OOP interview questions & answers.
OOP interview questions & answers.OOP interview questions & answers.
OOP interview questions & answers.
Questpond
 
OOP in C++
OOP in C++OOP in C++
OOP in C++
ppd1961
 
Vantagens e desvantagens de uma arquitetura microservices
Vantagens e desvantagens de uma arquitetura microservicesVantagens e desvantagens de uma arquitetura microservices
Vantagens e desvantagens de uma arquitetura microservices
Fábio Rosato
 
Basic Python Programming: Part 01 and Part 02
Basic Python Programming: Part 01 and Part 02Basic Python Programming: Part 01 and Part 02
Basic Python Programming: Part 01 and Part 02
Fariz Darari
 
Introduction to the basics of Python programming (part 1)
Introduction to the basics of Python programming (part 1)Introduction to the basics of Python programming (part 1)
Introduction to the basics of Python programming (part 1)
Pedro Rodrigues
 
introduction to programming languages
introduction to programming languagesintroduction to programming languages
introduction to programming languages
NaqashAhmad14
 
Macro and Preprocessor in c programming
 Macro and  Preprocessor in c programming Macro and  Preprocessor in c programming
Macro and Preprocessor in c programming
ProfSonaliGholveDoif
 

Similar to Computer Programming Past papers for DIT (20)

Object Oriented Programming using C++ PCIT102.pdf
Object Oriented Programming using C++ PCIT102.pdfObject Oriented Programming using C++ PCIT102.pdf
Object Oriented Programming using C++ PCIT102.pdf
GauravKumar295392
 
U19CS101 - PPS Unit 4 PPT (1).ppt
U19CS101 - PPS Unit 4 PPT (1).pptU19CS101 - PPS Unit 4 PPT (1).ppt
U19CS101 - PPS Unit 4 PPT (1).ppt
Manivannan837728
 
Book management system
Book management systemBook management system
Book management system
SHARDA SHARAN
 
17432 object oriented programming
17432   object oriented programming17432   object oriented programming
17432 object oriented programming
soni_nits
 
Spring 2014 CSCI 111 Final exam of 1 61. (2 points) Fl.docx
Spring 2014 CSCI 111 Final exam   of 1 61. (2 points) Fl.docxSpring 2014 CSCI 111 Final exam   of 1 61. (2 points) Fl.docx
Spring 2014 CSCI 111 Final exam of 1 61. (2 points) Fl.docx
rafbolet0
 
Introduction to c programming
Introduction to c programmingIntroduction to c programming
Introduction to c programming
Alpana Gupta
 
Presentation 2 (1).pdf
Presentation 2 (1).pdfPresentation 2 (1).pdf
Presentation 2 (1).pdf
ziyadaslanbey
 
c-for-c-programmers.pdf
c-for-c-programmers.pdfc-for-c-programmers.pdf
c-for-c-programmers.pdf
Salar32
 
C programming
C programmingC programming
C programming
PralhadKhanal1
 
Programming in C
Programming in CProgramming in C
Programming in C
Nishant Munjal
 
Programming in c
Programming in cProgramming in c
Programming in c
Ashutosh Srivasatava
 
c++ referesher 1.pdf
c++ referesher 1.pdfc++ referesher 1.pdf
c++ referesher 1.pdf
AnkurSingh656748
 
Unit 1
Unit 1Unit 1
Unit 1
Sowri Rajan
 
programming fundamental c++ course (1).pptx
programming fundamental c++ course (1).pptxprogramming fundamental c++ course (1).pptx
programming fundamental c++ course (1).pptx
NajafAli87
 
UNIT 1 NOTES.docx
UNIT 1 NOTES.docxUNIT 1 NOTES.docx
UNIT 1 NOTES.docx
Revathiparamanathan
 
C programming
C programmingC programming
C programming
Rounak Samdadia
 
C programming
C programmingC programming
C programming
Envision Computer Training Institute
 
Notes of c programming 1st unit BCA I SEM
Notes of c programming  1st unit BCA I SEMNotes of c programming  1st unit BCA I SEM
Notes of c programming 1st unit BCA I SEM
Mansi Tyagi
 
Basic c
Basic cBasic c
Basic c
Veera Karthi
 
C language introduction geeksfor geeks
C language introduction   geeksfor geeksC language introduction   geeksfor geeks
C language introduction geeksfor geeks
AashutoshChhedavi
 
Object Oriented Programming using C++ PCIT102.pdf
Object Oriented Programming using C++ PCIT102.pdfObject Oriented Programming using C++ PCIT102.pdf
Object Oriented Programming using C++ PCIT102.pdf
GauravKumar295392
 
U19CS101 - PPS Unit 4 PPT (1).ppt
U19CS101 - PPS Unit 4 PPT (1).pptU19CS101 - PPS Unit 4 PPT (1).ppt
U19CS101 - PPS Unit 4 PPT (1).ppt
Manivannan837728
 
Book management system
Book management systemBook management system
Book management system
SHARDA SHARAN
 
17432 object oriented programming
17432   object oriented programming17432   object oriented programming
17432 object oriented programming
soni_nits
 
Spring 2014 CSCI 111 Final exam of 1 61. (2 points) Fl.docx
Spring 2014 CSCI 111 Final exam   of 1 61. (2 points) Fl.docxSpring 2014 CSCI 111 Final exam   of 1 61. (2 points) Fl.docx
Spring 2014 CSCI 111 Final exam of 1 61. (2 points) Fl.docx
rafbolet0
 
Introduction to c programming
Introduction to c programmingIntroduction to c programming
Introduction to c programming
Alpana Gupta
 
Presentation 2 (1).pdf
Presentation 2 (1).pdfPresentation 2 (1).pdf
Presentation 2 (1).pdf
ziyadaslanbey
 
c-for-c-programmers.pdf
c-for-c-programmers.pdfc-for-c-programmers.pdf
c-for-c-programmers.pdf
Salar32
 
programming fundamental c++ course (1).pptx
programming fundamental c++ course (1).pptxprogramming fundamental c++ course (1).pptx
programming fundamental c++ course (1).pptx
NajafAli87
 
Notes of c programming 1st unit BCA I SEM
Notes of c programming  1st unit BCA I SEMNotes of c programming  1st unit BCA I SEM
Notes of c programming 1st unit BCA I SEM
Mansi Tyagi
 
C language introduction geeksfor geeks
C language introduction   geeksfor geeksC language introduction   geeksfor geeks
C language introduction geeksfor geeks
AashutoshChhedavi
 
Ad

Recently uploaded (20)

antiquity of writing in ancient India- literary & archaeological evidence
antiquity of writing in ancient India- literary & archaeological evidenceantiquity of writing in ancient India- literary & archaeological evidence
antiquity of writing in ancient India- literary & archaeological evidence
PrachiSontakke5
 
History Of The Monastery Of Mor Gabriel Philoxenos Yuhanon Dolabani
History Of The Monastery Of Mor Gabriel Philoxenos Yuhanon DolabaniHistory Of The Monastery Of Mor Gabriel Philoxenos Yuhanon Dolabani
History Of The Monastery Of Mor Gabriel Philoxenos Yuhanon Dolabani
fruinkamel7m
 
How to Share Accounts Between Companies in Odoo 18
How to Share Accounts Between Companies in Odoo 18How to Share Accounts Between Companies in Odoo 18
How to Share Accounts Between Companies in Odoo 18
Celine George
 
CNS infections (encephalitis, meningitis & Brain abscess
CNS infections (encephalitis, meningitis & Brain abscessCNS infections (encephalitis, meningitis & Brain abscess
CNS infections (encephalitis, meningitis & Brain abscess
Mohamed Rizk Khodair
 
How to Configure Public Holidays & Mandatory Days in Odoo 18
How to Configure Public Holidays & Mandatory Days in Odoo 18How to Configure Public Holidays & Mandatory Days in Odoo 18
How to Configure Public Holidays & Mandatory Days in Odoo 18
Celine George
 
LDMMIA Reiki Yoga S5 Daily Living Workshop
LDMMIA Reiki Yoga S5 Daily Living WorkshopLDMMIA Reiki Yoga S5 Daily Living Workshop
LDMMIA Reiki Yoga S5 Daily Living Workshop
LDM Mia eStudios
 
Drugs in Anaesthesia and Intensive Care,.pdf
Drugs in Anaesthesia and Intensive Care,.pdfDrugs in Anaesthesia and Intensive Care,.pdf
Drugs in Anaesthesia and Intensive Care,.pdf
crewot855
 
Ajanta Paintings: Study as a Source of History
Ajanta Paintings: Study as a Source of HistoryAjanta Paintings: Study as a Source of History
Ajanta Paintings: Study as a Source of History
Virag Sontakke
 
Cultivation Practice of Garlic in Nepal.pptx
Cultivation Practice of Garlic in Nepal.pptxCultivation Practice of Garlic in Nepal.pptx
Cultivation Practice of Garlic in Nepal.pptx
UmeshTimilsina1
 
Classification of mental disorder in 5th semester bsc. nursing and also used ...
Classification of mental disorder in 5th semester bsc. nursing and also used ...Classification of mental disorder in 5th semester bsc. nursing and also used ...
Classification of mental disorder in 5th semester bsc. nursing and also used ...
parmarjuli1412
 
What is the Philosophy of Statistics? (and how I was drawn to it)
What is the Philosophy of Statistics? (and how I was drawn to it)What is the Philosophy of Statistics? (and how I was drawn to it)
What is the Philosophy of Statistics? (and how I was drawn to it)
jemille6
 
How To Maximize Sales Performance using Odoo 18 Diverse views in sales module
How To Maximize Sales Performance using Odoo 18 Diverse views in sales moduleHow To Maximize Sales Performance using Odoo 18 Diverse views in sales module
How To Maximize Sales Performance using Odoo 18 Diverse views in sales module
Celine George
 
Chemotherapy of Malignancy -Anticancer.pptx
Chemotherapy of Malignancy -Anticancer.pptxChemotherapy of Malignancy -Anticancer.pptx
Chemotherapy of Malignancy -Anticancer.pptx
Mayuri Chavan
 
The role of wall art in interior designing
The role of wall art in interior designingThe role of wall art in interior designing
The role of wall art in interior designing
meghaark2110
 
Botany Assignment Help Guide - Academic Excellence
Botany Assignment Help Guide - Academic ExcellenceBotany Assignment Help Guide - Academic Excellence
Botany Assignment Help Guide - Academic Excellence
online college homework help
 
puzzle Irregular Verbs- Simple Past Tense
puzzle Irregular Verbs- Simple Past Tensepuzzle Irregular Verbs- Simple Past Tense
puzzle Irregular Verbs- Simple Past Tense
OlgaLeonorTorresSnch
 
How to Create Kanban View in Odoo 18 - Odoo Slides
How to Create Kanban View in Odoo 18 - Odoo SlidesHow to Create Kanban View in Odoo 18 - Odoo Slides
How to Create Kanban View in Odoo 18 - Odoo Slides
Celine George
 
U3 ANTITUBERCULAR DRUGS Pharmacology 3.pptx
U3 ANTITUBERCULAR DRUGS Pharmacology 3.pptxU3 ANTITUBERCULAR DRUGS Pharmacology 3.pptx
U3 ANTITUBERCULAR DRUGS Pharmacology 3.pptx
Mayuri Chavan
 
Transform tomorrow: Master benefits analysis with Gen AI today webinar, 30 A...
Transform tomorrow: Master benefits analysis with Gen AI today webinar,  30 A...Transform tomorrow: Master benefits analysis with Gen AI today webinar,  30 A...
Transform tomorrow: Master benefits analysis with Gen AI today webinar, 30 A...
Association for Project Management
 
Rock Art As a Source of Ancient Indian History
Rock Art As a Source of Ancient Indian HistoryRock Art As a Source of Ancient Indian History
Rock Art As a Source of Ancient Indian History
Virag Sontakke
 
antiquity of writing in ancient India- literary & archaeological evidence
antiquity of writing in ancient India- literary & archaeological evidenceantiquity of writing in ancient India- literary & archaeological evidence
antiquity of writing in ancient India- literary & archaeological evidence
PrachiSontakke5
 
History Of The Monastery Of Mor Gabriel Philoxenos Yuhanon Dolabani
History Of The Monastery Of Mor Gabriel Philoxenos Yuhanon DolabaniHistory Of The Monastery Of Mor Gabriel Philoxenos Yuhanon Dolabani
History Of The Monastery Of Mor Gabriel Philoxenos Yuhanon Dolabani
fruinkamel7m
 
How to Share Accounts Between Companies in Odoo 18
How to Share Accounts Between Companies in Odoo 18How to Share Accounts Between Companies in Odoo 18
How to Share Accounts Between Companies in Odoo 18
Celine George
 
CNS infections (encephalitis, meningitis & Brain abscess
CNS infections (encephalitis, meningitis & Brain abscessCNS infections (encephalitis, meningitis & Brain abscess
CNS infections (encephalitis, meningitis & Brain abscess
Mohamed Rizk Khodair
 
How to Configure Public Holidays & Mandatory Days in Odoo 18
How to Configure Public Holidays & Mandatory Days in Odoo 18How to Configure Public Holidays & Mandatory Days in Odoo 18
How to Configure Public Holidays & Mandatory Days in Odoo 18
Celine George
 
LDMMIA Reiki Yoga S5 Daily Living Workshop
LDMMIA Reiki Yoga S5 Daily Living WorkshopLDMMIA Reiki Yoga S5 Daily Living Workshop
LDMMIA Reiki Yoga S5 Daily Living Workshop
LDM Mia eStudios
 
Drugs in Anaesthesia and Intensive Care,.pdf
Drugs in Anaesthesia and Intensive Care,.pdfDrugs in Anaesthesia and Intensive Care,.pdf
Drugs in Anaesthesia and Intensive Care,.pdf
crewot855
 
Ajanta Paintings: Study as a Source of History
Ajanta Paintings: Study as a Source of HistoryAjanta Paintings: Study as a Source of History
Ajanta Paintings: Study as a Source of History
Virag Sontakke
 
Cultivation Practice of Garlic in Nepal.pptx
Cultivation Practice of Garlic in Nepal.pptxCultivation Practice of Garlic in Nepal.pptx
Cultivation Practice of Garlic in Nepal.pptx
UmeshTimilsina1
 
Classification of mental disorder in 5th semester bsc. nursing and also used ...
Classification of mental disorder in 5th semester bsc. nursing and also used ...Classification of mental disorder in 5th semester bsc. nursing and also used ...
Classification of mental disorder in 5th semester bsc. nursing and also used ...
parmarjuli1412
 
What is the Philosophy of Statistics? (and how I was drawn to it)
What is the Philosophy of Statistics? (and how I was drawn to it)What is the Philosophy of Statistics? (and how I was drawn to it)
What is the Philosophy of Statistics? (and how I was drawn to it)
jemille6
 
How To Maximize Sales Performance using Odoo 18 Diverse views in sales module
How To Maximize Sales Performance using Odoo 18 Diverse views in sales moduleHow To Maximize Sales Performance using Odoo 18 Diverse views in sales module
How To Maximize Sales Performance using Odoo 18 Diverse views in sales module
Celine George
 
Chemotherapy of Malignancy -Anticancer.pptx
Chemotherapy of Malignancy -Anticancer.pptxChemotherapy of Malignancy -Anticancer.pptx
Chemotherapy of Malignancy -Anticancer.pptx
Mayuri Chavan
 
The role of wall art in interior designing
The role of wall art in interior designingThe role of wall art in interior designing
The role of wall art in interior designing
meghaark2110
 
Botany Assignment Help Guide - Academic Excellence
Botany Assignment Help Guide - Academic ExcellenceBotany Assignment Help Guide - Academic Excellence
Botany Assignment Help Guide - Academic Excellence
online college homework help
 
puzzle Irregular Verbs- Simple Past Tense
puzzle Irregular Verbs- Simple Past Tensepuzzle Irregular Verbs- Simple Past Tense
puzzle Irregular Verbs- Simple Past Tense
OlgaLeonorTorresSnch
 
How to Create Kanban View in Odoo 18 - Odoo Slides
How to Create Kanban View in Odoo 18 - Odoo SlidesHow to Create Kanban View in Odoo 18 - Odoo Slides
How to Create Kanban View in Odoo 18 - Odoo Slides
Celine George
 
U3 ANTITUBERCULAR DRUGS Pharmacology 3.pptx
U3 ANTITUBERCULAR DRUGS Pharmacology 3.pptxU3 ANTITUBERCULAR DRUGS Pharmacology 3.pptx
U3 ANTITUBERCULAR DRUGS Pharmacology 3.pptx
Mayuri Chavan
 
Transform tomorrow: Master benefits analysis with Gen AI today webinar, 30 A...
Transform tomorrow: Master benefits analysis with Gen AI today webinar,  30 A...Transform tomorrow: Master benefits analysis with Gen AI today webinar,  30 A...
Transform tomorrow: Master benefits analysis with Gen AI today webinar, 30 A...
Association for Project Management
 
Rock Art As a Source of Ancient Indian History
Rock Art As a Source of Ancient Indian HistoryRock Art As a Source of Ancient Indian History
Rock Art As a Source of Ancient Indian History
Virag Sontakke
 
Ad

Computer Programming Past papers for DIT

  • 1. DIT Past Papers Paper: Computer Programming Compiled By: Engr. Jamal khan Paper: 2012 Q.1:-State the structure of a C / C++ program. Q.2:-What are C/C++ data types? Explain the following data types also write how they are declared. i) Boolean type ii) Character type iii) Integer type Q.3:-a)What do you mean by character constant? Give one example. b)What is 3 string constant? Explain with the help of one example. Q.4:-a)Define and explain Variable. b)Write the rules for constructing variable names. Q.5:-Write the purpose of the following functions in one line. a) get ( ) function b) put ( ) function c) getch ( ) function d) putch ( ) function e) gets ( ) function Q.6: -State about output using cout and input using cin by giving one example. Q.7: – a) What is a Do-While loop. Explain with the help of an example. b) What is a break statement? Give one example. Q.8:- a) What does relational operator do, list its different types. b) Write a C++ program to print first ten numbers. Paper 2013: Q.1:- Differentiate the following terms with suitable examples.
  • 2. 1. Variable Declaration and Variable Definition. 2. Identifier, Constant and Variable 3. Operands, Operators and Expression Q.2:- What will be the output of the following program segment. Explain the output. main () { int a=2, b=3, x, y; float w, z; x= a/b * b; y = b/a * a; w = a/b *b; z = b/a * a; printf( “%d%d %f %f *, a.b,w,z); } Q.3:- a) What is decision control structure ? Explain the if statement and if-else statement with the help of an example. b) Explain Break statement with example. Q.4:-Write a program which find and Print the largest of three numbers by using nested IF statement. Q5:- a)What is loop? Explain For Loop with the help of an example. b) What will be the output of the following program segment. main ( ) { int i; For (i=l;i <=5; printf (“ln%d”, i))
  • 3. i++; } Q.6:- a) What is Preprocessor Directive? Why we use # include Preprocessor Directive in the start of program? b) What is Header file? Give some examples of Header files are used in C/C++ Language. Q.7:-Explain the following operators with the help of an example. a) Compound Assignment Operators. b) Increment & Decrement Operators. c) Conditional Operator. Q.8:-Differentiate the following built-in functions. a) Printf () and Scanf () b) geleh () and Putch () c) Puts () and gels () d) Strlen () and Strlwr () e) Pow () and Sqrt () Paper : 2014 Q1:- Differentiate any five pairs from given. i) Signed and unsigned integer ii) STRLWR () and STRUPRO) iii) Break and continue statement iv) Prefix and postfix operator v) execution time value assignment and run time value assignment Q2: Write short notes on any two from the following with example 1) for loop 2) processor directive 3) arithmetic functions Q3: Write body structure for any five from the given
  • 4. i) NESTOD if-else statement ii) while loop iii) GOTO statement iv) declaration of user defined function v) print vi) C/C++ program structure Q4: Write output for any four from given logics. i) int a=5, b=10; printf(=b%a5%d/n”, b%a); ii) int n= 10 char=”*” printf(“%d”,ch) printf (%c”,chi); iii) int I,j ; for (i=1;i<5;i++) for(j=1;j<= 1,391) Printf(“*”); Printf (“n”) iv) printf(“%f’, ceil(9.9); v) printf(“%”, pow (5,2)); Part-B Q5: Write program that take a numb3er from user and show whether it is odd or even using if- else statement Q6: Elaborate while and do while loop in detail with one example. Q7: Elaborate user defined words and reserve words with examples Q8: Elaborate input and output statements. Also write down two functions of each statement. Paper : 2015 Q1:- Differentiate any five pairs from given. i) Signed and unsigned integer ii) STRLWR () and STRUPRO) iii) Break and continue statement iv) Prefix and postfix operator v) execution time value assignment and run time value assignment Q2: Write short notes on any two from the following with example 1) for loop 2) processor directive 3) arithmetic functions
  • 5. Q3: Write body structure for any five from the given i) NESTOD if-else statement ii) while loop iii) GOTO statement iv) declaration of user defined function v) print vi) C/C++ program structure Q4: Write output for any four from given logics. i) int a=5, b=10; printf(=b%a5%d/n”, b%a); ii) int n= 10 char=”*” printf(“%d”,ch) printf (%c”,chi); iii) int I,j ; for (i=1;i<5;i++) for(j=1;j<= 1,391) Printf(“*”); Printf (“n”) iv) printf(“%f’, ceil(9.9); v) printf(“%”, pow (5,2)); Part-B Q5: Write program that take a numb3er from user and show whether it is odd or even using if- else statement Q6: Elaborate while and do while loop in detail with one example. Q7: Elaborate user defined words and reserve words with examples Q8: Elaborate input and output statements. Also write down two functions of each statement. Paper : 2019 Q1. Explain C is considered to be a remarkable and powerful tool for programming. Also elaborate on the benefits of object-oriented programming. Q2. What are reserved words? Explain its usage with the help of programing example. Q3. Write a C program to print first ten natural number from 10 to 1 in descending order starting from 10, Using decrement operator without using loop. Q4. Write a program to print size of int, flout, double, char and bool data types on separate line using print function.
  • 6. Q5. Write a program to assign five different numbers to integer variables without appearing the entered number on the screen (Hint: use getch function) Q6. Wat are relational operators? Write a C Program to check if an entered number is divisible by 4 and 6 using nested if statement. Q7. What is the condition which leads to the use of continue statement in loops? Support your answer with a C programming example. Q8. What are library function? Write a C program to solve = √[(x2+y2) using sqrt () function let x=3 and y=4
  翻译: