SlideShare a Scribd company logo
A REVIEW ON
COMPUTER PROGRAMMING LAB
NAME :- PEESA JASWANTH
ROLL NO :- 24NU1A0241
BRANCH :- EEE
CODE :- 23ESX05
KEY FEATURES OF C SIMPLE AND EFFICIENT:-
C IS A STRAIGHT FORWARD LANGUAGE WITH A CLEAN SYNTAX .LOW
LEVEL ACCESS :
IT ALLOWS DIRECT MANIPULATION OF HARDWARE AND MEMORY,
MAKING IT POWERFUL FOR SYSTEM LEVEL PROGRAMMING.
PORTABLE: C PROGRAMS CAN RUN ON DIFFERENT MACHINES WITH
MINIMAL OR NO MODIFICATION . RICH LIBRARY : C PROVIDES A
STANDARDLIBRARY OF FUNCTIONS FOR COMMON TASKS. MODULAR
PROGRAMMING : SUPPORTS THE USE OF FUNCTIONS AND MODULES,
PROMOTING CODE REUSE
LAB COURSE OUTCOMES
AT THE END OF THE COMPUTER PROGRAMMING LAB WE ARE ABLE TO
CODE COURSE OUT COMES
23ESX05.1 Demonstrate the use of basic language features.
23ESX05.2 Apply the right control structure for solving the problem.
23ESX05.3 Implement the simple programs to solve computing problems
using user defined functions.
23ESXO5.4 Develop c programs using arrays and pointers
23ESX05.5 Experiment with user defined data types and file operations
PROGRAM OUTCOMES(Pos):-
The POs are the transactional statements of graduate attributes (GAs) that each graduating
engineer should possess in terms of
knowledge, skill and behaviour with a minimum target performance level at the time of
graduation as fixed by the program of study seeking continuous improvement year on year.
The graduates of Electrical & Electronics Engineering of NSRIT will be able to demonstrate the
following outcomes in terms of knowledge, skill and behavioural competencies at the time of
graduation with the expected target performance level.
1. Apply the knowledge of mathematics, science, engineering fundamentals, and an
engineering specialization to the solution of complex engineering problems. (Engineering
Knowledge)
2. Identify, formulate, review research literature, and analyse complex engineering
problems reaching substantiated conclusions using first principles of mathematics, natural
sciences, and engineering sciences. (Problem Analysis)
3. Design solutions for complex engineering problems and design system components or
processes that meet the
specified needs with appropriate consideration for the public health and safety, and the cultural,
societal, and
environmental considerations. (Design/Development of Solutions)
4. Use research-based knowledge and research methods including design of experiments,
analysis and interpretation
of data, and
synthesis of the information to provide valid conclusions. (Investigation of Complex Problems)
5. Create, select, and apply appropriate techniques, resources, and modern engineering and IT
tools including
prediction and modelling to complex engineering activities with an understanding of the
limitations. (Modern Tool
Usage)
6. Apply reasoning informed by the contextual knowledge to assess societal, health, safety, legal
and cultural issues
and the consequent responsibilities relevant to the professional engineering practice. (The
Engineer and Society)
7. Understand the impact of the professional engineering solutions in societal and environmental
contexts, and
demonstrate the knowledge of, and need for sustainable development. (The Environment and
Sustainability)
8. Apply ethical principles and commit to professional ethics and responsibilities and norms of
the engineering
practice. (Ethics)
9. Function effectively as an individual, and as a member or leader in diverse teams, and in
multidisciplinary settings.
(Individual and Team Work)
10. Use research-based knowledge and research methods including design of experiments,
analysis and
interpretation of data, and synthesis of the information to provide valid conclusions.
(Investigation of Complex
Problems)
11. Demonstrate knowledge and understanding of the engineering and management principles
and apply these to
one’s own work, as a member and leader in a team, to manage Projects and in multidisciplinary
environments. (Project
Finance and Management)
12. Recognize the need for, and have the preparation and ability to engage in independent and
life-long learning in the
broadest
context of technological change. (Life-Long Learning)
NAME OF THE EXPERIMENT:-
C PROGRAMS ON WHILE AND
FOR LOOPS
INTRODUCTION TO C PROGRAMMING
C is a general-purpose, procedural programming language that was developed in the
early 1970s by
Dennis Ritchie at Bell Labs. It is known for its efficiency and control, which makes it a
popular choice for
system programming, embedded systems, and real-time applications.
Key Features of C
1.Structured Programming: C promotes modularity and code organization through
functions and blocks.
2.Low-Level Access: C allows direct manipulation of memory and hardware, enabling fine-
grained
control over system resources.
3.Efficiency: C code is compiled into machine code, resulting in highly efficient and fast-
running
programs.
4.Portability: C programs can be compiled and run on various platforms with minimal
modifications.
5.Rich Standard Library: C offers a comprehensive standard library with functions for
Basic Input and Output Functions :-
Input and output operations are fundamental to any program. They enable the
program to interact
with the user, read data from files, and display results. In C, the standard input/output
library
provides the following essential functions:
➢ Printf() function:
• Used to print formatted output to the console.
• Syntax: printf("format string", argument1, argument2, ...);
• Example:
printf("Hello, world!n");
printf("The value of x is %dn", x);
➢ Scanf() function:
• Used to read formatted input from the console.
• Syntax: scanf("format string", &variable1, &variable2, ...);
• Example:
int age;
printf("Enter your age: ");
scanf("%d", &age);
Importance of Input and Output
Functions
• User Interaction:
Input and output functions allow programs to communicate with users,
prompting them for input and displaying results.
• Data Processing:
Programs can read data from files or other sources, process it, and write
the results to files or the console.
• Debugging:
Input and output functions can be used to print intermediate values and
trace the execution of a program to identify and fix errors.
PROGRAMS:
#include<stdio.h>
int main()
{
int n, reversed = O ,remainder , original;
printf(“Enter an integer”);
scanf(“%d”,&n);
original =n;
where(n! = 0)
{
remainder = n % 10;
reversed = reversed*10+ remainder;
n/=10;
}
if( original == reversed)
{
printf(“%d is a palindrome”, original);
}
else
{
printf(“%d is n0t a palindrome”.original);
}
return 0;
}
#include <stdio.h>
int main()
{
int num, originalNum, remainder, result = 0;
printf("Enter a three-digit integer: ");
scanf("%d", &num);
originalNum = num;
while (originalNum ! =0)
{
remainder = originalNum % 10;
result += remainder * remainder * remainder;
originalNum /= 10;
}
if (result == num)
{
printf("%d is an Armstrong number.", num);
}
else
{
printf(“%d is not an Armstrong number”,num);
}
return 0;
}
Real-Time Applications of Simple
C Programs with printf() and scanf()
While C is a powerful language often used for complex systems, even simple C programs utilizing
printf() and scanf() can have practical real-world applications. Here are a few examples:
➢ Data Entry and Validation:
1. Create a program to input personal details like name, age, and address.
2. Implement checks to ensure input is valid (e.g., age is a positive integer, email has the
correct
format).
3. Simulate a basic form where users input information, which can be processed and
stored.
➢ Basic Calculations:
1. Develop a simple calculator to perform arithmetic operations like addition,
subtraction, multiplication, and division.
2. Create a program to convert units (e.g., Celsius to Fahrenheit, kilometres to miles).
3. Calculate simple interest, compound interest, or loan repayments.
Key Considerations for Real-Time Applications:
➢ Efficiency :
Optimize code for speed and resource usage, especially in
embedded systems.
➢ Error Handling :
Implement robust error handling to prevent unexpected
behaviour.
➢ User Interface :
Design user-friendly interfaces, even for simple programs.
➢ Security :
Consider security implications, especially when dealing with
sensitive data.
➢ Testing :
Thoroughly test your code to ensure it works as expected.
By mastering the fundamentals of printf() and scanf(), you can
build the foundation for more complex C
THANK YOU

More Related Content

PDF
vtu data structures lab manual bcs304 pdf
PDF
IP Lab Manual for Kerala University 3 Year UG Programme
PPTX
Presentation on po pshjhhjhekhhkkhkhjpeo
DOC
complete data structure
DOC
Datastructurenotes 100627004340-phpapp01
PDF
Final 22POP13 Lab Manual- By SBL & PK.pdf
PPTX
Introduction to computers, input and output devices
PDF
Subject:Programming in C - Lab Programmes
vtu data structures lab manual bcs304 pdf
IP Lab Manual for Kerala University 3 Year UG Programme
Presentation on po pshjhhjhekhhkkhkhjpeo
complete data structure
Datastructurenotes 100627004340-phpapp01
Final 22POP13 Lab Manual- By SBL & PK.pdf
Introduction to computers, input and output devices
Subject:Programming in C - Lab Programmes

Similar to Physics lab ppt for btech students in engineetin (20)

PDF
Expection Setting-1st ppt-Reshma.pdfjjkk
PPTX
Expection Setting - 1st ppt. pptx
PDF
C Programming Lab manual 18CPL17
DOC
Datastructure notes
PPTX
C for Engineers
DOC
Notes of c programming 1st unit BCA I SEM
DOCX
Microcontroller lab manual 2022 scheme vtu
PPT
slidenotesece246jun2012-140803084954-phpapp01 (1).ppt
PPTX
3rd semester 4gsbshagscv.akshathamahsbpptx
PDF
Programming with c language practical manual
PPTX
Fundamental programming Nota Topic 2.pptx
PPTX
Introduction to c programming
PPTX
Team-7 SP.pptxdfghjksdfgduytredfghjkjhgffghj
PPTX
Introduction to C programming
PDF
Programming For Problem Solving Lecture Notes
PPTX
INTRODUCTON TO C LANGUAGE PRESENTATION.pptx
PDF
CS8461 Operating System Lab Manual S.Selvi
DOC
Stnotes doc 5
PPT
Unit1 C
PPT
Unit1 C
Expection Setting-1st ppt-Reshma.pdfjjkk
Expection Setting - 1st ppt. pptx
C Programming Lab manual 18CPL17
Datastructure notes
C for Engineers
Notes of c programming 1st unit BCA I SEM
Microcontroller lab manual 2022 scheme vtu
slidenotesece246jun2012-140803084954-phpapp01 (1).ppt
3rd semester 4gsbshagscv.akshathamahsbpptx
Programming with c language practical manual
Fundamental programming Nota Topic 2.pptx
Introduction to c programming
Team-7 SP.pptxdfghjksdfgduytredfghjkjhgffghj
Introduction to C programming
Programming For Problem Solving Lecture Notes
INTRODUCTON TO C LANGUAGE PRESENTATION.pptx
CS8461 Operating System Lab Manual S.Selvi
Stnotes doc 5
Unit1 C
Unit1 C
Ad

Recently uploaded (20)

PDF
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
PDF
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
PDF
Classroom Observation Tools for Teachers
PPTX
Orientation - ARALprogram of Deped to the Parents.pptx
PPTX
master seminar digital applications in india
PDF
OBE - B.A.(HON'S) IN INTERIOR ARCHITECTURE -Ar.MOHIUDDIN.pdf
PDF
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
PDF
A GUIDE TO GENETICS FOR UNDERGRADUATE MEDICAL STUDENTS
PDF
2.FourierTransform-ShortQuestionswithAnswers.pdf
PDF
Practical Manual AGRO-233 Principles and Practices of Natural Farming
PPTX
202450812 BayCHI UCSC-SV 20250812 v17.pptx
PPTX
Microbial diseases, their pathogenesis and prophylaxis
PDF
What if we spent less time fighting change, and more time building what’s rig...
PDF
Supply Chain Operations Speaking Notes -ICLT Program
PDF
Chinmaya Tiranga quiz Grand Finale.pdf
PDF
RTP_AR_KS1_Tutor's Guide_English [FOR REPRODUCTION].pdf
PDF
Paper A Mock Exam 9_ Attempt review.pdf.
PDF
GENETICS IN BIOLOGY IN SECONDARY LEVEL FORM 3
PDF
Complications of Minimal Access Surgery at WLH
PDF
01-Introduction-to-Information-Management.pdf
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
Classroom Observation Tools for Teachers
Orientation - ARALprogram of Deped to the Parents.pptx
master seminar digital applications in india
OBE - B.A.(HON'S) IN INTERIOR ARCHITECTURE -Ar.MOHIUDDIN.pdf
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
A GUIDE TO GENETICS FOR UNDERGRADUATE MEDICAL STUDENTS
2.FourierTransform-ShortQuestionswithAnswers.pdf
Practical Manual AGRO-233 Principles and Practices of Natural Farming
202450812 BayCHI UCSC-SV 20250812 v17.pptx
Microbial diseases, their pathogenesis and prophylaxis
What if we spent less time fighting change, and more time building what’s rig...
Supply Chain Operations Speaking Notes -ICLT Program
Chinmaya Tiranga quiz Grand Finale.pdf
RTP_AR_KS1_Tutor's Guide_English [FOR REPRODUCTION].pdf
Paper A Mock Exam 9_ Attempt review.pdf.
GENETICS IN BIOLOGY IN SECONDARY LEVEL FORM 3
Complications of Minimal Access Surgery at WLH
01-Introduction-to-Information-Management.pdf
Ad

Physics lab ppt for btech students in engineetin

  • 1. A REVIEW ON COMPUTER PROGRAMMING LAB NAME :- PEESA JASWANTH ROLL NO :- 24NU1A0241 BRANCH :- EEE CODE :- 23ESX05
  • 2. KEY FEATURES OF C SIMPLE AND EFFICIENT:- C IS A STRAIGHT FORWARD LANGUAGE WITH A CLEAN SYNTAX .LOW LEVEL ACCESS : IT ALLOWS DIRECT MANIPULATION OF HARDWARE AND MEMORY, MAKING IT POWERFUL FOR SYSTEM LEVEL PROGRAMMING. PORTABLE: C PROGRAMS CAN RUN ON DIFFERENT MACHINES WITH MINIMAL OR NO MODIFICATION . RICH LIBRARY : C PROVIDES A STANDARDLIBRARY OF FUNCTIONS FOR COMMON TASKS. MODULAR PROGRAMMING : SUPPORTS THE USE OF FUNCTIONS AND MODULES, PROMOTING CODE REUSE
  • 3. LAB COURSE OUTCOMES AT THE END OF THE COMPUTER PROGRAMMING LAB WE ARE ABLE TO CODE COURSE OUT COMES 23ESX05.1 Demonstrate the use of basic language features. 23ESX05.2 Apply the right control structure for solving the problem. 23ESX05.3 Implement the simple programs to solve computing problems using user defined functions. 23ESXO5.4 Develop c programs using arrays and pointers 23ESX05.5 Experiment with user defined data types and file operations
  • 4. PROGRAM OUTCOMES(Pos):- The POs are the transactional statements of graduate attributes (GAs) that each graduating engineer should possess in terms of knowledge, skill and behaviour with a minimum target performance level at the time of graduation as fixed by the program of study seeking continuous improvement year on year. The graduates of Electrical & Electronics Engineering of NSRIT will be able to demonstrate the following outcomes in terms of knowledge, skill and behavioural competencies at the time of graduation with the expected target performance level. 1. Apply the knowledge of mathematics, science, engineering fundamentals, and an engineering specialization to the solution of complex engineering problems. (Engineering Knowledge) 2. Identify, formulate, review research literature, and analyse complex engineering problems reaching substantiated conclusions using first principles of mathematics, natural sciences, and engineering sciences. (Problem Analysis)
  • 5. 3. Design solutions for complex engineering problems and design system components or processes that meet the specified needs with appropriate consideration for the public health and safety, and the cultural, societal, and environmental considerations. (Design/Development of Solutions) 4. Use research-based knowledge and research methods including design of experiments, analysis and interpretation of data, and synthesis of the information to provide valid conclusions. (Investigation of Complex Problems) 5. Create, select, and apply appropriate techniques, resources, and modern engineering and IT tools including prediction and modelling to complex engineering activities with an understanding of the limitations. (Modern Tool Usage) 6. Apply reasoning informed by the contextual knowledge to assess societal, health, safety, legal and cultural issues and the consequent responsibilities relevant to the professional engineering practice. (The Engineer and Society) 7. Understand the impact of the professional engineering solutions in societal and environmental contexts, and demonstrate the knowledge of, and need for sustainable development. (The Environment and Sustainability)
  • 6. 8. Apply ethical principles and commit to professional ethics and responsibilities and norms of the engineering practice. (Ethics) 9. Function effectively as an individual, and as a member or leader in diverse teams, and in multidisciplinary settings. (Individual and Team Work) 10. Use research-based knowledge and research methods including design of experiments, analysis and interpretation of data, and synthesis of the information to provide valid conclusions. (Investigation of Complex Problems) 11. Demonstrate knowledge and understanding of the engineering and management principles and apply these to one’s own work, as a member and leader in a team, to manage Projects and in multidisciplinary environments. (Project Finance and Management) 12. Recognize the need for, and have the preparation and ability to engage in independent and life-long learning in the broadest context of technological change. (Life-Long Learning)
  • 7. NAME OF THE EXPERIMENT:- C PROGRAMS ON WHILE AND FOR LOOPS
  • 8. INTRODUCTION TO C PROGRAMMING C is a general-purpose, procedural programming language that was developed in the early 1970s by Dennis Ritchie at Bell Labs. It is known for its efficiency and control, which makes it a popular choice for system programming, embedded systems, and real-time applications. Key Features of C 1.Structured Programming: C promotes modularity and code organization through functions and blocks. 2.Low-Level Access: C allows direct manipulation of memory and hardware, enabling fine- grained control over system resources. 3.Efficiency: C code is compiled into machine code, resulting in highly efficient and fast- running programs. 4.Portability: C programs can be compiled and run on various platforms with minimal modifications. 5.Rich Standard Library: C offers a comprehensive standard library with functions for
  • 9. Basic Input and Output Functions :- Input and output operations are fundamental to any program. They enable the program to interact with the user, read data from files, and display results. In C, the standard input/output library provides the following essential functions: ➢ Printf() function: • Used to print formatted output to the console. • Syntax: printf("format string", argument1, argument2, ...); • Example: printf("Hello, world!n"); printf("The value of x is %dn", x); ➢ Scanf() function: • Used to read formatted input from the console. • Syntax: scanf("format string", &variable1, &variable2, ...); • Example: int age; printf("Enter your age: "); scanf("%d", &age);
  • 10. Importance of Input and Output Functions • User Interaction: Input and output functions allow programs to communicate with users, prompting them for input and displaying results. • Data Processing: Programs can read data from files or other sources, process it, and write the results to files or the console. • Debugging: Input and output functions can be used to print intermediate values and trace the execution of a program to identify and fix errors.
  • 11. PROGRAMS: #include<stdio.h> int main() { int n, reversed = O ,remainder , original; printf(“Enter an integer”); scanf(“%d”,&n); original =n; where(n! = 0) { remainder = n % 10; reversed = reversed*10+ remainder; n/=10; } if( original == reversed)
  • 12. { printf(“%d is a palindrome”, original); } else { printf(“%d is n0t a palindrome”.original); } return 0; }
  • 13. #include <stdio.h> int main() { int num, originalNum, remainder, result = 0; printf("Enter a three-digit integer: "); scanf("%d", &num); originalNum = num; while (originalNum ! =0) { remainder = originalNum % 10; result += remainder * remainder * remainder; originalNum /= 10; } if (result == num) { printf("%d is an Armstrong number.", num);
  • 14. } else { printf(“%d is not an Armstrong number”,num); } return 0; }
  • 15. Real-Time Applications of Simple C Programs with printf() and scanf() While C is a powerful language often used for complex systems, even simple C programs utilizing printf() and scanf() can have practical real-world applications. Here are a few examples: ➢ Data Entry and Validation: 1. Create a program to input personal details like name, age, and address. 2. Implement checks to ensure input is valid (e.g., age is a positive integer, email has the correct format). 3. Simulate a basic form where users input information, which can be processed and stored. ➢ Basic Calculations: 1. Develop a simple calculator to perform arithmetic operations like addition, subtraction, multiplication, and division. 2. Create a program to convert units (e.g., Celsius to Fahrenheit, kilometres to miles). 3. Calculate simple interest, compound interest, or loan repayments.
  • 16. Key Considerations for Real-Time Applications: ➢ Efficiency : Optimize code for speed and resource usage, especially in embedded systems. ➢ Error Handling : Implement robust error handling to prevent unexpected behaviour. ➢ User Interface : Design user-friendly interfaces, even for simple programs. ➢ Security : Consider security implications, especially when dealing with sensitive data. ➢ Testing : Thoroughly test your code to ensure it works as expected. By mastering the fundamentals of printf() and scanf(), you can build the foundation for more complex C