This document discusses program structure, data types, variables, operators, input/output functions, and debugging in C programming. It provides sample code for a program that calculates the sum of two integers entered by the user. The key steps are: 1) declaring integer variables for the two numbers and their sum, 2) using printf and scanf functions to input the numbers and output the result, and 3) returning 0 at the end of the main function. The document also covers preprocessor directives, data types, naming conventions, arithmetic and logical operators, and debugging techniques.
C Programming - Basics of c -history of cDHIVYAB17
The document provides an introduction to C programming, covering topics such as what a program is, programming languages, the history of C, and the development stages of a C program. It discusses the key components of a C program including directives, the main function, and program structures. Examples are provided to illustrate C code structure and the use of variables, keywords, operators, input/output functions, and formatting output with printf.
And practice program with some MCQ questions to familiar with the concepts.
The document discusses various C programming concepts like algorithms, flowcharts, tokens, data types, operators, functions, and hardware components of a computer. It includes questions and answers on these topics. Key points covered are definition of algorithm and flowchart, different types of tokens in C, differences between while and do-while loops, definition of software and its types, and examples of standard header files.
This document provides an introduction to the C programming language. It discusses that C was developed in the 1970s and became a popular language due to its efficiency, ability to handle low-level tasks, and ability to compile on different platforms. The document then discusses the structure of a C program and provides examples of basic input/output programs. It also defines key C concepts like variables, data types, operators, and functions.
The document provides an overview of the C programming language. It discusses that C is commonly used for embedded systems and systems programming tasks like operating systems and compilers. It was developed between 1969-1973 along with Unix. The "Hello World" example program is shown to demonstrate the basic structure of a C program with main() as the entry point. Data types, variables, and basic I/O functions like printf() and scanf() are described. Operators for arithmetic, comparison, logic, and assignment are also covered.
Pointers allow a variable to hold the memory address of another variable. A pointer variable contains the address of the variable it points to. Pointers can be used to pass arguments to functions by reference instead of by value, allowing the function to modify the original variables. Pointers also allow a function to return multiple values by having the function modify pointer variables passed to it by the calling function. Understanding pointers involves grasping that a pointer variable contains an address rather than a value, and that pointers enable indirect access to the value at a specific memory address.
This document provides an introduction to the C programming language. It discusses fundamental C elements like data types, variables, constants, operators, and input/output functions. It explains how a basic C program is structured and compiled. Examples are provided to demonstrate simple C statements, arithmetic expressions, and how to write and run a first program that prints text. The key topics covered include basic syntax, program structure, data types, identifiers, operators, and input/output functions like printf() and scanf().
This document summarizes key concepts from an introduction to C++ programming chapter, including:
- The main parts of a C++ program are comments, preprocessor directives, the main() function, and statements.
- Variables are used to store and manipulate data in a program. Variables are declared with a name and type before use.
- Arithmetic operators allow performing calculations in C++ programs. Expressions follow order of operations rules.
- Input and output streams allow getting user input and displaying output to the screen.
Programming languages are designed to communicate with machines like computers. Programs are sets of instructions written in a programming language following its syntax to serve some purpose. C++ was developed in the 1980s as an object-oriented programming language. OOP views a problem in terms of objects rather than procedures. A programming language's character set includes letters, digits, symbols, and whitespace that it can recognize as valid characters. The smallest units of a program are tokens like keywords, identifiers, literals, operators, and punctuators.
This document provides an overview of the C programming language. It discusses that C was developed in 1972 at Bell Labs and is a popular systems and applications programming language. The document then covers various C language concepts like data types, variables, operators, input/output functions, and provides examples of basic C programs and code snippets.
The document provides an overview of the C programming language development environment and basic concepts:
1. It describes the six phases of converting C code into an executable program: editing, preprocessing, compiling, assembling, linking, and running.
2. It introduces basic C programming concepts like variables, data types, statements, comments, functions, and input/output functions like printf(), scanf(), getchar(), and putchar().
3. It explains the six types of tokens used in C programs - keywords, identifiers, constants, string literals, punctuators, and operators - and provides examples of each.
This document discusses tokens in the C programming language. It defines tokens as the basic building blocks of a C program, including keywords, identifiers, constants, string literals, and symbols. It provides examples of different token types and explains their meanings. It also covers identifiers, keywords, variables, constants, strings, input/output functions, and writing a basic C program.
The document is a student submission from Dinobandhu Thokdar of Kaliacchak Government Polytechnic. It includes the student's personal details such as name, registration number, semester, and branch of study. The submission is for the subject "Basics of C".
The document provides an introduction to the C programming language. It discusses the structure of a C program including documentation, preprocessor directives, header files, and function definitions. It also describes various math and trigonometric functions available in the standard library like sqrt, pow, sin, cos, and log. The rest of the document outlines the steps to compile and execute a C program and defines key concepts like variables, constants, and data types in C.
This document discusses various fundamental concepts in C programming such as flowcharts, pseudocode, control structures, variables, data types, operators, functions, arrays, structures, and input/output functions. It provides definitions and examples for each concept. Control structures covered include conditional statements like if-else and switch-case, as well as loops like while, do-while and for. Data types discussed are integer, floating point, character and string constants. Key concepts like variables, arrays, structures, functions and their declarations are also summarized.
C is a middle-level general purpose programming language developed in 1972. It uses characters, keywords, variables, constants, data types, expressions and operators. Variables are named locations used to store and manipulate data during execution. C supports several data types including integer, float, character and others. Operators perform actions like arithmetic, relational, logical and bitwise operations on variables and constants.
This document provides an introduction to Python programming concepts including data types, operators, control flow statements, functions and modules. It discusses the basic Python data types like integers, floats, booleans, strings, lists, tuples, dictionaries and sets. It also covers Python operators like arithmetic, assignment, comparison, logical and identity operators. Additionally, it describes control flow statements like if/else and for loops. Finally, it touches on functions, modules and input/output statements in Python.
Here is a C program to produce a spiral array as described in the task:
#include <stdio.h>
int main() {
int n = 5;
int arr[n][n];
int num = 1;
int rowBegin = 0;
int rowEnd = n-1;
int colBegin = 0;
int colEnd = n-1;
while(rowBegin <= rowEnd && colBegin <= colEnd) {
// Top row
for(int i=colBegin; i<=colEnd; i++) {
arr[rowBegin][i] = num++;
}
rowBegin++;
// Right column
for(int i=rowBegin;
The document provides an overview of the history and basics of C++ programming. It discusses:
- Bjarne Stroustrup created C++ in the early 1980s as an extension of C to support object-oriented programming.
- A typical C++ environment includes a program development environment, the C++ language itself, and the C++ Standard Library.
- A C++ program goes through several phases: edit, preprocess, compile, link, load, and execute.
- Basic C++ concepts covered include variables, data types, operators, and common errors.
The document discusses various topics related to tokens, variables, data types, and operators in C programming. It defines tokens as the smallest elements identified by the compiler, such as keywords, identifiers, string literals, and operators. It describes different variable types like local variables, global variables, and static variables. It also explains various data types in C like integer, float, char, etc and their sizes and ranges. Finally, it discusses various arithmetic, relational, logical, and assignment operators in C and their precedence.
Grannie’s Journey to Using Healthcare AI ExperiencesLauren Parr
AI offers transformative potential to enhance our long-time persona Grannie’s life, from healthcare to social connection. This session explores how UX designers can address unmet needs through AI-driven solutions, ensuring intuitive interfaces that improve safety, well-being, and meaningful interactions without overwhelming users.
Exploring the advantages of on-premises Dell PowerEdge servers with AMD EPYC processors vs. the cloud for small to medium businesses’ AI workloads
AI initiatives can bring tremendous value to your business, but you need to support your new AI workloads effectively. That means choosing the best possible infrastructure for your needs—and many companies are finding that the cloud isn’t right for them. According to a recent Rackspace survey of IT executives, 69 percent of companies have moved some of their applications on-premises from the cloud, with half of those citing security and compliance as the reason and 44 percent citing cost.
On-premises solutions provide a number of advantages. With full control over your security infrastructure, you can be certain that all compliance requirements remain firmly in the hands of your IT team. Opting for on-premises also gives you the ability to design your infrastructure to the precise needs of that team and your new AI workloads. Depending on the workload, you may also see performance benefits, along with more predictable costs. As you start to build your next AI initiative, consider an on-premises solution utilizing AMD EPYC processor-powered Dell PowerEdge servers.
More Related Content
Similar to Variable< Arithmetic Expressions and Input (20)
This document provides an introduction to the C programming language. It discusses fundamental C elements like data types, variables, constants, operators, and input/output functions. It explains how a basic C program is structured and compiled. Examples are provided to demonstrate simple C statements, arithmetic expressions, and how to write and run a first program that prints text. The key topics covered include basic syntax, program structure, data types, identifiers, operators, and input/output functions like printf() and scanf().
This document summarizes key concepts from an introduction to C++ programming chapter, including:
- The main parts of a C++ program are comments, preprocessor directives, the main() function, and statements.
- Variables are used to store and manipulate data in a program. Variables are declared with a name and type before use.
- Arithmetic operators allow performing calculations in C++ programs. Expressions follow order of operations rules.
- Input and output streams allow getting user input and displaying output to the screen.
Programming languages are designed to communicate with machines like computers. Programs are sets of instructions written in a programming language following its syntax to serve some purpose. C++ was developed in the 1980s as an object-oriented programming language. OOP views a problem in terms of objects rather than procedures. A programming language's character set includes letters, digits, symbols, and whitespace that it can recognize as valid characters. The smallest units of a program are tokens like keywords, identifiers, literals, operators, and punctuators.
This document provides an overview of the C programming language. It discusses that C was developed in 1972 at Bell Labs and is a popular systems and applications programming language. The document then covers various C language concepts like data types, variables, operators, input/output functions, and provides examples of basic C programs and code snippets.
The document provides an overview of the C programming language development environment and basic concepts:
1. It describes the six phases of converting C code into an executable program: editing, preprocessing, compiling, assembling, linking, and running.
2. It introduces basic C programming concepts like variables, data types, statements, comments, functions, and input/output functions like printf(), scanf(), getchar(), and putchar().
3. It explains the six types of tokens used in C programs - keywords, identifiers, constants, string literals, punctuators, and operators - and provides examples of each.
This document discusses tokens in the C programming language. It defines tokens as the basic building blocks of a C program, including keywords, identifiers, constants, string literals, and symbols. It provides examples of different token types and explains their meanings. It also covers identifiers, keywords, variables, constants, strings, input/output functions, and writing a basic C program.
The document is a student submission from Dinobandhu Thokdar of Kaliacchak Government Polytechnic. It includes the student's personal details such as name, registration number, semester, and branch of study. The submission is for the subject "Basics of C".
The document provides an introduction to the C programming language. It discusses the structure of a C program including documentation, preprocessor directives, header files, and function definitions. It also describes various math and trigonometric functions available in the standard library like sqrt, pow, sin, cos, and log. The rest of the document outlines the steps to compile and execute a C program and defines key concepts like variables, constants, and data types in C.
This document discusses various fundamental concepts in C programming such as flowcharts, pseudocode, control structures, variables, data types, operators, functions, arrays, structures, and input/output functions. It provides definitions and examples for each concept. Control structures covered include conditional statements like if-else and switch-case, as well as loops like while, do-while and for. Data types discussed are integer, floating point, character and string constants. Key concepts like variables, arrays, structures, functions and their declarations are also summarized.
C is a middle-level general purpose programming language developed in 1972. It uses characters, keywords, variables, constants, data types, expressions and operators. Variables are named locations used to store and manipulate data during execution. C supports several data types including integer, float, character and others. Operators perform actions like arithmetic, relational, logical and bitwise operations on variables and constants.
This document provides an introduction to Python programming concepts including data types, operators, control flow statements, functions and modules. It discusses the basic Python data types like integers, floats, booleans, strings, lists, tuples, dictionaries and sets. It also covers Python operators like arithmetic, assignment, comparison, logical and identity operators. Additionally, it describes control flow statements like if/else and for loops. Finally, it touches on functions, modules and input/output statements in Python.
Here is a C program to produce a spiral array as described in the task:
#include <stdio.h>
int main() {
int n = 5;
int arr[n][n];
int num = 1;
int rowBegin = 0;
int rowEnd = n-1;
int colBegin = 0;
int colEnd = n-1;
while(rowBegin <= rowEnd && colBegin <= colEnd) {
// Top row
for(int i=colBegin; i<=colEnd; i++) {
arr[rowBegin][i] = num++;
}
rowBegin++;
// Right column
for(int i=rowBegin;
The document provides an overview of the history and basics of C++ programming. It discusses:
- Bjarne Stroustrup created C++ in the early 1980s as an extension of C to support object-oriented programming.
- A typical C++ environment includes a program development environment, the C++ language itself, and the C++ Standard Library.
- A C++ program goes through several phases: edit, preprocess, compile, link, load, and execute.
- Basic C++ concepts covered include variables, data types, operators, and common errors.
The document discusses various topics related to tokens, variables, data types, and operators in C programming. It defines tokens as the smallest elements identified by the compiler, such as keywords, identifiers, string literals, and operators. It describes different variable types like local variables, global variables, and static variables. It also explains various data types in C like integer, float, char, etc and their sizes and ranges. Finally, it discusses various arithmetic, relational, logical, and assignment operators in C and their precedence.
Grannie’s Journey to Using Healthcare AI ExperiencesLauren Parr
AI offers transformative potential to enhance our long-time persona Grannie’s life, from healthcare to social connection. This session explores how UX designers can address unmet needs through AI-driven solutions, ensuring intuitive interfaces that improve safety, well-being, and meaningful interactions without overwhelming users.
Exploring the advantages of on-premises Dell PowerEdge servers with AMD EPYC processors vs. the cloud for small to medium businesses’ AI workloads
AI initiatives can bring tremendous value to your business, but you need to support your new AI workloads effectively. That means choosing the best possible infrastructure for your needs—and many companies are finding that the cloud isn’t right for them. According to a recent Rackspace survey of IT executives, 69 percent of companies have moved some of their applications on-premises from the cloud, with half of those citing security and compliance as the reason and 44 percent citing cost.
On-premises solutions provide a number of advantages. With full control over your security infrastructure, you can be certain that all compliance requirements remain firmly in the hands of your IT team. Opting for on-premises also gives you the ability to design your infrastructure to the precise needs of that team and your new AI workloads. Depending on the workload, you may also see performance benefits, along with more predictable costs. As you start to build your next AI initiative, consider an on-premises solution utilizing AMD EPYC processor-powered Dell PowerEdge servers.
Securiport is a border security systems provider with a progressive team approach to its task. The company acknowledges the importance of specialized skills in creating the latest in innovative security tech. The company has offices throughout the world to serve clients, and its employees speak more than twenty languages at the Washington D.C. headquarters alone.
Contributing to WordPress With & Without Code.pptxPatrick Lumumba
Contributing to WordPress: Making an Impact on the Test Team—With or Without Coding Skills
WordPress survives on collaboration, and the Test Team plays a very important role in ensuring the CMS is stable, user-friendly, and accessible to everyone.
This talk aims to deconstruct the myth that one has to be a developer to contribute to WordPress. In this session, I will share with the audience how to get involved with the WordPress Team, whether a coder or not.
We’ll explore practical ways to contribute, from testing new features, and patches, to reporting bugs. By the end of this talk, the audience will have the tools and confidence to make a meaningful impact on WordPress—no matter the skill set.
UiPath Community Berlin: Studio Tips & Tricks and UiPath InsightsUiPathCommunity
Join the UiPath Community Berlin (Virtual) meetup on May 27 to discover handy Studio Tips & Tricks and get introduced to UiPath Insights. Learn how to boost your development workflow, improve efficiency, and gain visibility into your automation performance.
📕 Agenda:
- Welcome & Introductions
- UiPath Studio Tips & Tricks for Efficient Development
- Best Practices for Workflow Design
- Introduction to UiPath Insights
- Creating Dashboards & Tracking KPIs (Demo)
- Q&A and Open Discussion
Perfect for developers, analysts, and automation enthusiasts!
This session streamed live on May 27, 18:00 CET.
Check out all our upcoming UiPath Community sessions at:
👉 https://community.uipath.com/events/
Join our UiPath Community Berlin chapter:
👉 https://community.uipath.com/berlin/
Jeremy Millul - A Talented Software DeveloperJeremy Millul
Jeremy Millul is a talented software developer based in NYC, known for leading impactful projects such as a Community Engagement Platform and a Hiking Trail Finder. Using React, MongoDB, and geolocation tools, Jeremy delivers intuitive applications that foster engagement and usability. A graduate of NYU’s Computer Science program, he brings creativity and technical expertise to every project, ensuring seamless user experiences and meaningful results in software development.
Evaluation Challenges in Using Generative AI for Science & Technical ContentPaul Groth
Evaluation Challenges in Using Generative AI for Science & Technical Content.
Foundation Models show impressive results in a wide-range of tasks on scientific and legal content from information extraction to question answering and even literature synthesis. However, standard evaluation approaches (e.g. comparing to ground truth) often don't seem to work. Qualitatively the results look great but quantitive scores do not align with these observations. In this talk, I discuss the challenges we've face in our lab in evaluation. I then outline potential routes forward.
European Accessibility Act & Integrated Accessibility TestingJulia Undeutsch
Emma Dawson will guide you through two important topics in this session.
Firstly, she will prepare you for the European Accessibility Act (EAA), which comes into effect on 28 June 2025, and show you how development teams can prepare for it.
In the second part of the webinar, Emma Dawson will explore with you various integrated testing methods and tools that will help you improve accessibility during the development cycle, such as Linters, Storybook, Playwright, just to name a few.
Focus: European Accessibility Act, Integrated Testing tools and methods (e.g. Linters, Storybook, Playwright)
Target audience: Everyone, Developers, Testers
Data Virtualization: Bringing the Power of FME to Any ApplicationSafe Software
Imagine building web applications or dashboards on top of all your systems. With FME’s new Data Virtualization feature, you can deliver the full CRUD (create, read, update, and delete) capabilities on top of all your data that exploit the full power of FME’s all data, any AI capabilities. Data Virtualization enables you to build OpenAPI compliant API endpoints using FME Form’s no-code development platform.
In this webinar, you’ll see how easy it is to turn complex data into real-time, usable REST API based services. We’ll walk through a real example of building a map-based app using FME’s Data Virtualization, and show you how to get started in your own environment – no dev team required.
What you’ll take away:
-How to build live applications and dashboards with federated data
-Ways to control what’s exposed: filter, transform, and secure responses
-How to scale access with caching, asynchronous web call support, with API endpoint level security.
-Where this fits in your stack: from web apps, to AI, to automation
Whether you’re building internal tools, public portals, or powering automation – this webinar is your starting point to real-time data delivery.
GDG Cloud Southlake #43: Tommy Todd: The Quantum Apocalypse: A Looming Threat...James Anderson
The Quantum Apocalypse: A Looming Threat & The Need for Post-Quantum Encryption
We explore the imminent risks posed by quantum computing to modern encryption standards and the urgent need for post-quantum cryptography (PQC).
Bio: With 30 years in cybersecurity, including as a CISO, Tommy is a strategic leader driving security transformation, risk management, and program maturity. He has led high-performing teams, shaped industry policies, and advised organizations on complex cyber, compliance, and data protection challenges.
Measuring Microsoft 365 Copilot and Gen AI SuccessNikki Chapple
Session | Measuring Microsoft 365 Copilot and Gen AI Success with Viva Insights and Purview
Presenter | Nikki Chapple 2 x MVP and Principal Cloud Architect at CloudWay
Event | European Collaboration Conference 2025
Format | In person Germany
Date | 28 May 2025
📊 Measuring Copilot and Gen AI Success with Viva Insights and Purview
Presented by Nikki Chapple – Microsoft 365 MVP & Principal Cloud Architect, CloudWay
How do you measure the success—and manage the risks—of Microsoft 365 Copilot and Generative AI (Gen AI)? In this ECS 2025 session, Microsoft MVP and Principal Cloud Architect Nikki Chapple explores how to go beyond basic usage metrics to gain full-spectrum visibility into AI adoption, business impact, user sentiment, and data security.
🎯 Key Topics Covered:
Microsoft 365 Copilot usage and adoption metrics
Viva Insights Copilot Analytics and Dashboard
Microsoft Purview Data Security Posture Management (DSPM) for AI
Measuring AI readiness, impact, and sentiment
Identifying and mitigating risks from third-party Gen AI tools
Shadow IT, oversharing, and compliance risks
Microsoft 365 Admin Center reports and Copilot Readiness
Power BI-based Copilot Business Impact Report (Preview)
📊 Why AI Measurement Matters: Without meaningful measurement, organizations risk operating in the dark—unable to prove ROI, identify friction points, or detect compliance violations. Nikki presents a unified framework combining quantitative metrics, qualitative insights, and risk monitoring to help organizations:
Prove ROI on AI investments
Drive responsible adoption
Protect sensitive data
Ensure compliance and governance
🔍 Tools and Reports Highlighted:
Microsoft 365 Admin Center: Copilot Overview, Usage, Readiness, Agents, Chat, and Adoption Score
Viva Insights Copilot Dashboard: Readiness, Adoption, Impact, Sentiment
Copilot Business Impact Report: Power BI integration for business outcome mapping
Microsoft Purview DSPM for AI: Discover and govern Copilot and third-party Gen AI usage
🔐 Security and Compliance Insights: Learn how to detect unsanctioned Gen AI tools like ChatGPT, Gemini, and Claude, track oversharing, and apply eDLP and Insider Risk Management (IRM) policies. Understand how to use Microsoft Purview—even without E5 Compliance—to monitor Copilot usage and protect sensitive data.
📈 Who Should Watch: This session is ideal for IT leaders, security professionals, compliance officers, and Microsoft 365 admins looking to:
Maximize the value of Microsoft Copilot
Build a secure, measurable AI strategy
Align AI usage with business goals and compliance requirements
🔗 Read the blog https://nikkichapple.com/measuring-copilot-gen-ai/
Co-Constructing Explanations for AI Systems using ProvenancePaul Groth
Explanation is not a one off - it's a process where people and systems work together to gain understanding. This idea of co-constructing explanations or explanation by exploration is powerful way to frame the problem of explanation. In this talk, I discuss our first experiments with this approach for explaining complex AI systems by using provenance. Importantly, I discuss the difficulty of evaluation and discuss some of our first approaches to evaluating these systems at scale. Finally, I touch on the importance of explanation to the comprehensive evaluation of AI systems.
6th Power Grid Model Meetup
Join the Power Grid Model community for an exciting day of sharing experiences, learning from each other, planning, and collaborating.
This hybrid in-person/online event will include a full day agenda, with the opportunity to socialize afterwards for in-person attendees.
If you have a hackathon proposal, tell us when you register!
About Power Grid Model
The global energy transition is placing new and unprecedented demands on Distribution System Operators (DSOs). Alongside upgrades to grid capacity, processes such as digitization, capacity optimization, and congestion management are becoming vital for delivering reliable services.
Power Grid Model is an open source project from Linux Foundation Energy and provides a calculation engine that is increasingly essential for DSOs. It offers a standards-based foundation enabling real-time power systems analysis, simulations of electrical power grids, and sophisticated what-if analysis. In addition, it enables in-depth studies and analysis of the electrical power grid’s behavior and performance. This comprehensive model incorporates essential factors such as power generation capacity, electrical losses, voltage levels, power flows, and system stability.
Power Grid Model is currently being applied in a wide variety of use cases, including grid planning, expansion, reliability, and congestion studies. It can also help in analyzing the impact of renewable energy integration, assessing the effects of disturbances or faults, and developing strategies for grid control and optimization.
Improving Developer Productivity With DORA, SPACE, and DevExJustin Reock
Ready to measure and improve developer productivity in your organization?
Join Justin Reock, Deputy CTO at DX, for an interactive session where you'll learn actionable strategies to measure and increase engineering performance.
Leave this session equipped with a comprehensive understanding of developer productivity and a roadmap to create a high-performing engineering team in your company.
Supercharge Your AI Development with Local LLMsFrancesco Corti
In today's AI development landscape, developers face significant challenges when building applications that leverage powerful large language models (LLMs) through SaaS platforms like ChatGPT, Gemini, and others. While these services offer impressive capabilities, they come with substantial costs that can quickly escalate especially during the development lifecycle. Additionally, the inherent latency of web-based APIs creates frustrating bottlenecks during the critical testing and iteration phases of development, slowing down innovation and frustrating developers.
This talk will introduce the transformative approach of integrating local LLMs directly into their development environments. By bringing these models closer to where the code lives, developers can dramatically accelerate development lifecycles while maintaining complete control over model selection and configuration. This methodology effectively reduces costs to zero by eliminating dependency on pay-per-use SaaS services, while opening new possibilities for comprehensive integration testing, rapid prototyping, and specialized use cases.
New Ways to Reduce Database Costs with ScyllaDBScyllaDB
How ScyllaDB’s latest capabilities can reduce your infrastructure costs
ScyllaDB has been obsessed with price-performance from day 1. Our core database is architected with low-level engineering optimizations that squeeze every ounce of power from the underlying infrastructure. And we just completed a multi-year effort to introduce a set of new capabilities for additional savings.
Join this webinar to learn about these new capabilities: the underlying challenges we wanted to address, the workloads that will benefit most from each, and how to get started. We’ll cover ways to:
- Avoid overprovisioning with “just-in-time” scaling
- Safely operate at up to ~90% storage utilization
- Cut network costs with new compression strategies and file-based streaming
We’ll also highlight a “hidden gem” capability that lets you safely balance multiple workloads in a single cluster. To conclude, we will share the efficiency-focused capabilities on our short-term and long-term roadmaps.
Multistream in SIP and NoSIP @ OpenSIPS Summit 2025Lorenzo Miniero
Slides for my "Multistream support in the Janus SIP and NoSIP plugins" presentation at the OpenSIPS Summit 2025 event.
They describe my efforts refactoring the Janus SIP and NoSIP plugins to allow for the gatewaying of an arbitrary number of audio/video streams per call (thus breaking the current 1-audio/1-video limitation), plus some additional considerations on what this could mean when dealing with application protocols negotiated via SIP as well.
Multistream in SIP and NoSIP @ OpenSIPS Summit 2025Lorenzo Miniero
Ad
Variable< Arithmetic Expressions and Input
1. Chapter 2
Variables, Arithmetic Expressions and
Input/Output
C Programming
a Q & A Approach
by H.H. Tan, T.B. D’Orazio, S.H. Or & Marian M.Y. Choy
2. 2
2.1 Variables: Naming, Declaring,
Assigning and Printing Values
Question:
Calculate the area of 10,000 triangles, all of different
sizes. Suppose you have the following information:
1. the length of each of the three sides
2. the size of each three angles
Solutions:
1. representing the information with variables
2. write down the correct formula to calculate the result
1
l
2
l
3
l
1 2
* *sin( ) / 2.0
S l l
In Algebraic
3. 3
2.1 Variables: Naming, Declaring,
Assigning and Printing Values
For programming in C
choose the variable names,
consist of entire words rather than single
characters
easier to understand your programs if given
very descriptive names to each variable
4. 4
2.1 Variables: Naming, Declaring,
Assigning and Printing Values
We may use variable names
Lengths: length1, length2, length3
Angles: angle1, angle2, angle3
Much less ambiguous than their algebraic
counterparts
Expressions look more cumbersome
length of expression may span over 1 line
Disadvantage which we simply must live with
Try your best to make the name descriptive – or
make sense
5. 5
2.1 Variables: Naming, Declaring,
Assigning and Printing Values
What can be chosen for variable names in C?
first character must be non-digit characters a–z,
A–Z, or _
other characters must be non-digit characters
a–z, A–Z, _, or digit 0–9
Valid examples
apple1 interest_rate xfloat Income one_two
Invalid
1apple interest_rate% float In come one.two
6. 6
2.1 Variables: Naming, Declaring,
Assigning and Printing Values
Can we use void, int, printf as a variable names?
List of key words in C
auto break case char const continue default
do double else enum extern float for
goto if int long register return short
signed sizeof static struct switch typedef union
unsigned void volatile while
You could choose key words as variable names, but are strongly
suggested not to do it.
NO
7. 7
Table 2.1
Some Constraints on Identifiers
Topic
Use of standard identifiers such
as printf
Use of uppercase or mixed-case
Comment
Standard identifiers, such as
the function name printf, can
be used as variable names.
However, their use is not
recommended because it
leads to confusion.
Allowed; however, many
programmers use lowercase
characters for variable names
and uppercase for constant
names. Differentiate your
identifiers by using different
characters rather than
different cases
8. 8
2.1 Variables: Naming, Declaring,
Assigning and Printing Values
In C statement, we might have
length1 = 3.0;
length2 = 8.0;
angle1 = 30.0;
length1 = 30.0;
length2 = 80.0;
angle1 = 60.0;
1* 2*sin( 1)/2.0;
Area length length angle
length1 length2 angle1 Area
9. 9
2.1 Variables: Naming, Declaring,
Assigning and Printing Values
But,
Variable names must be declared before
To define a variable, the syntaxes are:
data_type variable_name;
data_type variable_name1, variable_name2, … ;
e.g:
int iex;
float length;
float angle1, angle2;
double length1, length2;
10. In C, data type categorized as:
1. Primitive Types in ANSI C (C89)/ISO C (C90) -
char, short, int, float and double.
2. Primitive Types added to ISO C (C99) - long
long
3. User Defined Types – struct, union, enum
and typedef (will be discussed in separate session).
4. Derived Types – pointer, array (will be discussed in
separate session).
C BASIC DATA TYPES
2/31
16. 16
2.1 Variables: Naming, Declaring,
Assigning and Printing Values
Notes on Assignment operator =
put the value on the right hand size of
assignment operator to the variable name on
the left;
the precedence of operation order is from right
to left;
the left side of “=“ must be a variable
expressions on the right hand has to be
evaluated before assignment
Assignment can be done with declaration
float income=20.5, expense=8.5;
float saving= income - expense;
17. 17
2.1 Variables: Naming, Declaring,
Assigning and Printing Values
How to print out variable area during execution?
18. 18
2.1 Variables: Naming, Declaring,
Assigning and Printing Values
How to print out variable value during execution?
printf (format_string, argument_list)
format_string:
plane_character , conversion_specification
print out directly how to display
To display integer: %[field width]d e.g. %5d
To display float: %[field width][.precision]f e.g %9.2f
argument_list:
variables/constant to be fed
19. 19
int month;
float expense, income;
month = 12;
expense = 111.1;
income = 100.;
printf ("Month=%2d, Expense=$%9.2fn",
month, expense);
Result
2.1 Variables: Naming, Declaring,
Assigning and Printing Values
21. 21
int month;
float expense, income;
month = 11;
expense = 82.1;
income = 100.;
printf ("For the %2dth month of the yearn"
"the expenses were $%5.2f n"
"and the income was $%6.2fnn",
month, expense, income);
Result?
2.1 Variables: Naming, Declaring,
Assigning and Printing Values
22. 22
printf
To display the value of a variable or constant on the screen
printf(format_string,argument_list);
format_string
plain characters – displayed directly unchanged on the screen, e.g. “This is C”
conversion specification(s) – used to convert, format and display argument(s)
from the argument_list
escape sequences – control the cursor, for example, the newline ‘n’
Each argument must have a format specification. For example,
printf("month=%5d ",month);
23. 23
printf
Each argument must have a format specification. For example,
printf("month=%5d n",month);
What will you get when:
int people = 456356;
printf(“people =%5dn",people);
printf(“people =%9dn”,people);
Question:
How is the case when we deal float numbers?
24. 24
printf
Problem in Engineering:
float people= 0.000001;
What will you get when:
printf(“people =%fn",people);
Using scientific notation
printf(“people =%en", people);
28. 28
We can instruct the computer to retrieve
data from various input devices
the keyboard
a mouse
the hard disk drive
Programs that have input from the keyboard
usually create a dialogue between the
program and the user during execution
2.2 Reading Data from The Keyboard
29. 29
This is done by printing out an hint
message,e.g.,
printf(“please input the current month (int): ”)
scanf(“%d”,&month);
2.2 Reading Data from The Keyboard
30. 30
Input data from keyboard can be done using scanf() function
scanf(format_string, argument_list)
format_string : converts input characters into a specified type
argument_list: addresses of variables in which the input data are
stored;
Example
float income;
double expense;
scanf(“%f %lf”,&income, &expense);
& is required to get the address of variable
2.2 Reading Data from The Keyboard
31. 31
scanf() function
scanf("%f%lf", &income, &expense);
&income stands for the address of the memory cell for income
& : “address of” operator
&income - pass the address of variable income to function scanf
By giving scanf the address, the program knows where in memory to put
the value typed
2.2 Reading Data from The Keyboard
32. 32
printf("what was your month salary in 2015?n");
scanf("%f", &salary);
printf("How many months have you worked?n");
scanf("%d",&work_month);
printf("what did you earn on vocation month?n");
scanf(" %f",&vocation_salary);
printf("what was month expense in 2015?n");
scanf("%f",&expense);
2.2Reading Data from The Keyboard
keyboard input
keyboard input
keyboard input
keyboard input
dialogue
33. 33
2.2 Reading Data from The Keyboard
float income;
double expense;
int month, hour, minute;
printf ("What month is it?n");
scanf ("%d", &month);
printf ("You have entered month=%5dn",month);
34. 34
scanf() function
scanf (format_string, argument_list);
format_string converts characters in the input into
values of a specific type
2.2 Reading Data from The Keyboard
35. 2.2 Reading Data from The
Keyboard
argument_list contains the address of the variable(s)
into which the input data are stored. e.g.
scanf("%f%lf",&income,&expense);
1st
keyboard input data converted to float (%f) =>
income
2nd
keyboard input converted to double (%lf) =>
expense
35
36. printf ("Please enter your income and expensesn");
scanf ("%f%lf", &income,&expense);
printf ("Please enter the time, e.g., ");
scanf ("%d : %d", &hour,&minute);
printf ("Entered Time=%d:%dn",hour,minute);
36
41. 41
2.3 Arithmetic Operators
and Expressions
Consists of a sequence of operand(s) and
operator(s) that specify the computation of a
value
Look much like algebraic expressions that you
write
d = x/y; // x divided by y
Assigns the value of the arithmetic
expression(division) on the right to the variable
on the left
Is correct to write
x/y =d ; ?
Wrong
42. 42
2.3 Arithmetic Operators
and Expressions
Calculate the time needed for a car to drive
from A to B with constant speed v
Calculate the how many groups we have in
the class if each group has 4 students?
47. 47
2.3 Arithmetic Operators and
Expressions
Operators ++, --, and %
++ increment operator, can be placed before or after a
variable
increase the value of the variable by 1
i++; or ++i;
equivalent to i=i+1;
i--; or --i;
same as i=i-1;
Only difference between i++ and ++i is in order of increment
(addressed later)
% is a remainder operator
must be placed between two integer variables or constants
e.g. 11%3 return 2
48. 48
2.3 Arithmetic Operators
and Expressions
Depending on data types, division get can you
different answers
int i=3, j = 5, k;
float x = 3.0, y=5.0,z;
k = i/j;
z = x/y;
remainder operator only accept integer
operands
k = i%j; right
z = x%y; wrong
49. 49
2.3 Arithmetic Operators
and Expressions
Cannot write
x/y = d;
i + 1 = i;
Left side of assignment statement can have
only single variable
Single variables are allowed to be lvalues
(allowed to be on the left side of assignment
)
Expressions are rvalues (allowed on the
right side of assignment )
50. 50
Conversion Specification
If the precision specified for a real is
less than actual, displays only the number of
digits in the specified precision (trailing digits are
not lost from memory, they simply are not
displayed)
greater than actual, adds trailing zeros to make
the displayed precision equal to the precision
specified
not specified, makes the precision equal to six
51. 51
int DAYS_IN_YEAR = 365;
//One int value displayed in different field width
printf ("CONVERSION SPECIFICATIONS FOR INTEGERS n
n");
printf ("Days in year = n"
"[[%1d]] t(field width less than actual)n"
"[[%9d]] t(field width greater than actual)
n"
"[[%d]] t(no field width specified) nnn",
DAYS_IN_YEAR, DAYS_IN_YEAR, DAYS_IN_YEAR);
52. 52
float PI=3.14159;
//One float value displayed in different field width
printf ("CONVERSION SPECIFICATIONS FOR REAL NUMBERSnn");
printf ("Cases for precision being specified correctly
n");
printf ("PI = n"
"[[%1.5f]] tt(field width less than actual) n"
"[[%15.5f]] t(field width greater than actual)n"
"[[%.5f]] tt(no field width specified) nn",
PI,PI,PI);
53. 53
float PI=3.14159;
//One float value displayed in different precision
printf ("Cases for field width being specified
correctly n");
printf ("PI = n"
"[[%7.2f]] tt(precision less than actual) n"
"[[%7.8f]] tt(precision greater than actual)n"
"[[%7.f]] tt(no precision specified) nn",
PI,PI,PI);
54. 54
Conversion Specification
Display int with %f or float with %d?
likely get nonsensical values or zeros
displayed
common error beginners make
Why was so much attention given to the
printf statement?
will write printf statements very frequently
can substantially reduce your programming
errors
55. 55
Constant
constant can be done using constant macro
# define PI 3.1415926
it is a preprocessing directive, it replace the occurrence of macro name (PI) by its value (3.1415926)
it is not a C statement, no “;” at the end
it is usually appear after preprocessing directives
E.g.:
# include <stdio.h>
# define DAY_OF_WEEK 7
void main(void)
{
printf(“total =%dn”,DAY_OF_WEEK);
}
56. 56
Preprocessor
To create a constant macro
use a preprocessor directive
begin with the symbol # (which must begin the line)
semicolon must not be used at the end
General form
#define symbolic_name replacement
#define DAYS_IN_YEAR 365
Draw equivalent of DAYS_IN_YEAR to 365
Prior to translation into machine code, the preprocessor
replaces every symbolic_name in the program with the
given replacement
printf("Days in year=%5d
n",DAYS_IN_YEAR);
after preprocessing becomes
printf("Days in year=%5dn",365);
57. 57
2.4 Mixed Type Arithmetic,
Giving variables their first numerical values is called
initializing them, e.g.
x = 5;
Usually complicated expression is placed
Order of performance of numerical operations can be
controlled
Rules about the order of operation of +, -, *, / are
established by setting the precedence of the
operators
Operators of higher precedence are executed first
while those of lower precedence are executed later
58. 58
Operator Name No of operands Position Associativity Precedence
( parentheses unary prefix L to R 1
) parentheses unary postfix L to R 1
+ positive sign unary prefix R to L 2
- negative sign unary prefix R to L 2
++ post-increment unary postfix L to R 2
-- post-decrement unary postfix L to R 2
++ pre-increment unary prefix R to L 2
-- pre-decrement unary prefix R to L 2
+= addition and assignment binary infix R to L 2
-= subtraction and
assignment
binary infix R to L 2
*= multiplication and
assignment
binary infix R to L 2
/= division and assignment binary infix R to L 2
%= remainder and assignment binary infix R to L 2
% remainder binary infix L to R 3
* multiplication binary infix L to R 3
/ division binary infix L to R 3
+ addition binary infix L to R 4
- subtraction binary infix L to R 4
= assignment binary infix R to L 5
59. *=
Multiply the value of the first operand by the value of the second
operand; store the result in the object specified by the first operand.
A*=B; // A=A*B;
/=
Divide the value of the first operand by the value of the second
operand; store the result in the object specified by the first operand.
A/=B; // A=A/B;
%=
Take modulus of the first operand specified by the value of the
second operand; store the result in the object specified by the first
operand.
A%=B; // A=A%B;
+=
Add the value of the second operand to the value of the first
operand; store the result in the object specified by the first operand.
A+=B; // A=A+B;
–=
Subtract the value of the second operand from the value of the first
operand; store the result in the object specified by the first operand.
A-=B; // A=A-B;
59
Compound Assignment
60. 60
Variable Initialization/Increment
Operator
How do we initialize variables?
1. Uses an assignment statement, e.g.
int e ; e=3;
2. Initializes in a declaration statement, e.g.
float a=7, b=6;
– int i = 1, j =1;
int k = i++;
– int h = ++j ;
– For 1st
expression,
1. value of i is first assigned to k
2. i is then incremented (post-increment ++) from 1 to 2
– For 2nd
one,
1. value of j is first incremented (pre-increment operator ++) from
1 to 2.
2. Then the new j value, now equal to 2, is assigned to h
?i,j,k,h
61. 61
Mixed Data Type
Calculation
6.0/4.0 = 1.5
6/4 = 1
6/4.0 = 1.5
C converts integer to
real temporarily and
perform the operation
62. 62
cast Operators
Change the type of an expression
temporarily
General form
(type) expression
int aa=5, bb=2;
float xx;
xx = (float) aa / bb;
xx = 2.5, otherwise xx = 2.0
Force a floating
Point division
63. 63
Controlling Precedence
Arithmetic operators located within the
parentheses() always have highest
precedence
Example
z = ((a+b)*c/d);
a+b evaluated first
64. 64
Associativity
Specifies the direction of evaluation of
the operators with the same
precedence
1+2 -3
First evaluated
Next evaluated
Direction of evaluation
65. 65
Further Exploration
Assign an integer value to a float variable
convert the result to float and store to variable
e.g.,
float p = 6 / 4;
floating variable p will store 1.0
66. 66
Summary
#define symbolic_name replacement
where symbolic_name occurred throughout the rest of
program will be replaced by replacement during compilation
by preprocessor
Format specifications
%[flag][field width][.precision]type
where format string components enclosed by [ ] are optional
Output of a float number to scientific notation is
[sign]d.ddd e[sign]ddd
where d represents a digit
67. 67
Summary
During mixed mode (different data types) arithmetic, C
will automatically convert one of the operands to facilitate
calculations
Sometimes type casting can be used to explicitly change
data type during calculation
(type) operand
where type is the target type being converted into
operand is the data to be casted
68. 68
Summary
Basic structure of a program
# include<stdio.h>
void main()
{
statements;
}
Constant with preprocessing
using #define CONT_NAME value
# define DAY_OF_YEAR 365
Define variables
data_type variable_name ;
int number; float salary; double rate;
Indentation
69. 69
Summary
Output data on to screen
printf(format_string, argument_lists)
printf("You input %dn", month);
Get data from keyboard
scanf(format_string, address_variables)
scanf("%d, %f", &month, &salary);
Mathematical Operators
+, -, *, /, %, ++, --, +=,-=, *=, …
binary operators require its operands of same type
% works on integers
/ depends on operands
70. 70
Home work 4
Calculate the average score of a students within
one semester. Suppose there are 3 courses in
total.
Procedures
• Question description(not code in program):
• average_score = (score1+score2+score3)/3
• Steps of programming:
• define variables with right data type
• ask user to input 3 scores from keyboard
• convert the math expression into C code
• Output the results (keep 2 decimal places)