Fundamental of C Programming Language and Basic Input/Output Functionimtiazalijoono
Fundamental of C Programming Language
and
Basic Input/Output Function
contents
C Development Environment
C Program Structure
Basic Data Types
Input/Output function
Common Programming Error
Fundamental of C Programming Language and Basic Input/Output Functionimtiazalijoono
Fundamental of C Programming Language
and
Basic Input/Output Function
contents
C Development Environment
C Program Structure
Basic Data Types
Input/Output function
Common Programming Error
Brief description on subprograms and functions it helps to u . In any case u cn understand the descripion and concepts with easy manner. I think it helps to u
This presentation shows how to use CMake to probe the platform (operating system/environment) and compiler to identify required or optional language/platform features. A complete example is shown for adapting a program to discovered features.
Programming is hard. Programming correct C and C++ is particularly hard. Indeed, both in C and certainly in C++, it is uncommon to see a screenful containing only well defined and conforming code.Why do professional programmers write code like this? Because most programmers do not have a deep understanding of the language they are using.While they sometimes know that certain things are undefined or unspecified, they often do not know why it is so. In these slides we will study small code snippets in C and C++, and use them to discuss the fundamental building blocks, limitations and underlying design philosophies of these wonderful but dangerous programming languages.
This content has a CC license. Feel free to use it for whatever you want. You may download the original PDF file from: http://www.pvv.org/~oma/DeepC_slides_oct2012.pdf
Brief description on subprograms and functions it helps to u . In any case u cn understand the descripion and concepts with easy manner. I think it helps to u
This presentation shows how to use CMake to probe the platform (operating system/environment) and compiler to identify required or optional language/platform features. A complete example is shown for adapting a program to discovered features.
Programming is hard. Programming correct C and C++ is particularly hard. Indeed, both in C and certainly in C++, it is uncommon to see a screenful containing only well defined and conforming code.Why do professional programmers write code like this? Because most programmers do not have a deep understanding of the language they are using.While they sometimes know that certain things are undefined or unspecified, they often do not know why it is so. In these slides we will study small code snippets in C and C++, and use them to discuss the fundamental building blocks, limitations and underlying design philosophies of these wonderful but dangerous programming languages.
This content has a CC license. Feel free to use it for whatever you want. You may download the original PDF file from: http://www.pvv.org/~oma/DeepC_slides_oct2012.pdf
5.Hello World program Explanation. ||C Programming tutorial.Fiaz Hussain
Today we are going to learn hello world Program explanation. This is fifth video of our C language course. In this video we learn what is preprocessor directive, two types of preprocessor directive i.e. include preprocessor directive and define preprocessor directive, header file or library file, main function, body of main function, c statement and purpose of return 0 statement.
----------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------
Aslam O Alikum, My name is Fiaz Hussain, and you’re watching my YouTube channel Coding Series
If you have any question or suggestion then please comments below. I tried my best to reply your comments.
I hope you will enjoy this video, if you enjoy this video then please like this video and share with Friends. And don’t forget to subscribe my channel.
Thanks
----------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------
Join me on Facebook:
Facebook Link: https://bit.ly/2QuNoTn
Join me on Instagram:
Instagram Link: https://bit.ly/2OuI9AK
Join me on Twitter:
Twitter Link: https://bit.ly/2puOV0N
Programming Fundamentals Functions in C and typesimtiazalijoono
Programming Fundamentals
Functions in C
Lecture Outline
• Functions
• Function declaration
• Function call
• Function definition
– Passing arguments to function
1) Passing constants
2) Passing variables
– Pass by value
– Returning values from functions
• Preprocessor directives
• Local and external variables
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf91mobiles
91mobiles recently conducted a Smart TV Buyer Insights Survey in which we asked over 3,000 respondents about the TV they own, aspects they look at on a new TV, and their TV buying preferences.
GraphRAG is All You need? LLM & Knowledge GraphGuy Korland
Guy Korland, CEO and Co-founder of FalkorDB, will review two articles on the integration of language models with knowledge graphs.
1. Unifying Large Language Models and Knowledge Graphs: A Roadmap.
https://arxiv.org/abs/2306.08302
2. Microsoft Research's GraphRAG paper and a review paper on various uses of knowledge graphs:
https://www.microsoft.com/en-us/research/blog/graphrag-unlocking-llm-discovery-on-narrative-private-data/
Accelerate your Kubernetes clusters with Varnish CachingThijs Feryn
A presentation about the usage and availability of Varnish on Kubernetes. This talk explores the capabilities of Varnish caching and shows how to use the Varnish Helm chart to deploy it to Kubernetes.
This presentation was delivered at K8SUG Singapore. See https://feryn.eu/presentations/accelerate-your-kubernetes-clusters-with-varnish-caching-k8sug-singapore-28-2024 for more details.
Epistemic Interaction - tuning interfaces to provide information for AI supportAlan Dix
Paper presented at SYNERGY workshop at AVI 2024, Genoa, Italy. 3rd June 2024
https://alandix.com/academic/papers/synergy2024-epistemic/
As machine learning integrates deeper into human-computer interactions, the concept of epistemic interaction emerges, aiming to refine these interactions to enhance system adaptability. This approach encourages minor, intentional adjustments in user behaviour to enrich the data available for system learning. This paper introduces epistemic interaction within the context of human-system communication, illustrating how deliberate interaction design can improve system understanding and adaptation. Through concrete examples, we demonstrate the potential of epistemic interaction to significantly advance human-computer interaction by leveraging intuitive human communication strategies to inform system design and functionality, offering a novel pathway for enriching user-system engagements.
Neuro-symbolic is not enough, we need neuro-*semantic*Frank van Harmelen
Neuro-symbolic (NeSy) AI is on the rise. However, simply machine learning on just any symbolic structure is not sufficient to really harvest the gains of NeSy. These will only be gained when the symbolic structures have an actual semantics. I give an operational definition of semantics as “predictable inference”.
All of this illustrated with link prediction over knowledge graphs, but the argument is general.
Essentials of Automations: Optimizing FME Workflows with ParametersSafe Software
Are you looking to streamline your workflows and boost your projects’ efficiency? Do you find yourself searching for ways to add flexibility and control over your FME workflows? If so, you’re in the right place.
Join us for an insightful dive into the world of FME parameters, a critical element in optimizing workflow efficiency. This webinar marks the beginning of our three-part “Essentials of Automation” series. This first webinar is designed to equip you with the knowledge and skills to utilize parameters effectively: enhancing the flexibility, maintainability, and user control of your FME projects.
Here’s what you’ll gain:
- Essentials of FME Parameters: Understand the pivotal role of parameters, including Reader/Writer, Transformer, User, and FME Flow categories. Discover how they are the key to unlocking automation and optimization within your workflows.
- Practical Applications in FME Form: Delve into key user parameter types including choice, connections, and file URLs. Allow users to control how a workflow runs, making your workflows more reusable. Learn to import values and deliver the best user experience for your workflows while enhancing accuracy.
- Optimization Strategies in FME Flow: Explore the creation and strategic deployment of parameters in FME Flow, including the use of deployment and geometry parameters, to maximize workflow efficiency.
- Pro Tips for Success: Gain insights on parameterizing connections and leveraging new features like Conditional Visibility for clarity and simplicity.
We’ll wrap up with a glimpse into future webinars, followed by a Q&A session to address your specific questions surrounding this topic.
Don’t miss this opportunity to elevate your FME expertise and drive your projects to new heights of efficiency.
DevOps and Testing slides at DASA ConnectKari Kakkonen
My and Rik Marselis slides at 30.5.2024 DASA Connect conference. We discuss about what is testing, then what is agile testing and finally what is Testing in DevOps. Finally we had lovely workshop with the participants trying to find out different ways to think about quality and testing in different parts of the DevOps infinity loop.
Key Trends Shaping the Future of Infrastructure.pdfCheryl Hung
Keynote at DIGIT West Expo, Glasgow on 29 May 2024.
Cheryl Hung, ochery.com
Sr Director, Infrastructure Ecosystem, Arm.
The key trends across hardware, cloud and open-source; exploring how these areas are likely to mature and develop over the short and long-term, and then considering how organisations can position themselves to adapt and thrive.
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Jeffrey Haguewood
Sidekick Solutions uses Bonterra Impact Management (fka Social Solutions Apricot) and automation solutions to integrate data for business workflows.
We believe integration and automation are essential to user experience and the promise of efficient work through technology. Automation is the critical ingredient to realizing that full vision. We develop integration products and services for Bonterra Case Management software to support the deployment of automations for a variety of use cases.
This video focuses on the notifications, alerts, and approval requests using Slack for Bonterra Impact Management. The solutions covered in this webinar can also be deployed for Microsoft Teams.
Interested in deploying notification automations for Bonterra Impact Management? Contact us at sales@sidekicksolutionsllc.com to discuss next steps.
JMeter webinar - integration with InfluxDB and GrafanaRTTS
Watch this recorded webinar about real-time monitoring of application performance. See how to integrate Apache JMeter, the open-source leader in performance testing, with InfluxDB, the open-source time-series database, and Grafana, the open-source analytics and visualization application.
In this webinar, we will review the benefits of leveraging InfluxDB and Grafana when executing load tests and demonstrate how these tools are used to visualize performance metrics.
Length: 30 minutes
Session Overview
-------------------------------------------
During this webinar, we will cover the following topics while demonstrating the integrations of JMeter, InfluxDB and Grafana:
- What out-of-the-box solutions are available for real-time monitoring JMeter tests?
- What are the benefits of integrating InfluxDB and Grafana into the load testing stack?
- Which features are provided by Grafana?
- Demonstration of InfluxDB and Grafana using a practice web application
To view the webinar recording, go to:
https://www.rttsweb.com/jmeter-integration-webinar
The Art of the Pitch: WordPress Relationships and SalesLaura Byrne
Clients don’t know what they don’t know. What web solutions are right for them? How does WordPress come into the picture? How do you make sure you understand scope and timeline? What do you do if sometime changes?
All these questions and more will be explored as we talk about matching clients’ needs with what your agency offers without pulling teeth or pulling your hair out. Practical tips, and strategies for successful relationship building that leads to closing the deal.
Securing your Kubernetes cluster_ a step-by-step guide to success !KatiaHIMEUR1
Today, after several years of existence, an extremely active community and an ultra-dynamic ecosystem, Kubernetes has established itself as the de facto standard in container orchestration. Thanks to a wide range of managed services, it has never been so easy to set up a ready-to-use Kubernetes cluster.
However, this ease of use means that the subject of security in Kubernetes is often left for later, or even neglected. This exposes companies to significant risks.
In this talk, I'll show you step-by-step how to secure your Kubernetes cluster for greater peace of mind and reliability.
Elevating Tactical DDD Patterns Through Object CalisthenicsDorra BARTAGUIZ
After immersing yourself in the blue book and its red counterpart, attending DDD-focused conferences, and applying tactical patterns, you're left with a crucial question: How do I ensure my design is effective? Tactical patterns within Domain-Driven Design (DDD) serve as guiding principles for creating clear and manageable domain models. However, achieving success with these patterns requires additional guidance. Interestingly, we've observed that a set of constraints initially designed for training purposes remarkably aligns with effective pattern implementation, offering a more ‘mechanical’ approach. Let's explore together how Object Calisthenics can elevate the design of your tactical DDD patterns, offering concrete help for those venturing into DDD for the first time!
Elevating Tactical DDD Patterns Through Object Calisthenics
Unit 5
1. F1001 PROGRAMMING FUNDAMENTALS
UNIT
5
STRUCTURE OF C PROGRAM
Basic Concepts of C Programming
Important Elements In A C Program
Data and Variables
Input and Output
70
2. F1001 PROGRAMMING FUNDAMENTALS
INTRODUCTION
In this unit students are introduced to a simple C program. The unit describes the important elements of a
C program and the types of data that can be processed by C. It also describes C statements for performing
tasks such as getting data from the user and displaying the data on screen. Here students will be presented
with examples that illustrate many important features of C programming.
At the end of this unit, students should be able to write simple C programs in accordance to the rules and
conditions of C programming. By this time, they should know the ways to declare variables, use variables
and understand the naming conventions of variables and print outputs. Students should also have enough
knowledge to write clear, well documented and error free codes at the end of this chapter.
Basic C program structure
Comments
/* Example of basic C program Structure */
#include <stdio.h> Header File
Pre-processor
commands #define MAX 20
void main() Main Function
{ Start of main function
Constant const PI = 3.142;
Data Type char letter;
Variable
int number;
huruf = ‘A’;
Output Function printf(“Enter one number : “);
Input Function scanf(“%d”, &number);
} End of main function
NOTES
The curly braces “{ }” symbol shows the body of the program body. Any code/statements must
be written inside the body.
71
3. F1001 PROGRAMMING FUNDAMENTALS
Comments
• A line starting with /* and ending with */ is a comment.
• The purpose of a comment is to document and understand the program. It can be used to tell what is the
purpose of using variables or functions. It also enables your program to be easily understood by others.
• Comment will not be executed by the compiler.
• A good programming practice is to have comments in the program
Examples :
/* this is a comment */
/* This is
also
a comment */
Main function and functions
• Every C program contains a main function which is called main()
• Program execution starts from this main function.
• main() function has two parts:
main() (i) head
{
char b;
b = ‘A’; (ii) body
}
HEAD BODY
• Every function must have a header. • Every function must have a body which starts
• Function header is the name of that function. with an open curly bracket ‘{’ and ends with
• main() function has a fixed name. a close curly bracket ‘}’.
• We cannot change the name of main() • Every body function contains a program
function statement.
• A program statement will perform certain
tasks such as receiving value, display value,
calculation and so on.
Pre-processor Commands
72
4. F1001 PROGRAMMING FUNDAMENTALS
• #include <stdio.h>
# • Lines starting with the ‘#’ symbol is processed by the pre-processor,
before compiling the program.
#include • Is known as pre-processor directive.
• Each pre-processor directive has its own header file.
• Pre-processor directive gives instruction so that manipulation can be
done on the programs. Example, by instructing the processor to
include other files that are needed by the program.
#include
<FileName>
or
<stdio.h> • Used for the process of displaying output on the screen or getting
input from the user via the keyboard ( example printf and scanf)
73
5. F1001 PROGRAMMING FUNDAMENTALS
• #define AGE 22
# • Lines starting with the ‘#’ symbol is processed by the pre-processor,
before compiling the program.
#define • It does a search-and-replace command on a word processor
(editor)
#define <constant name> <constant value>
AGE • Name of constant
• Usually written in CAPITAL letters
22 • Value assigned to AGE
Examples of Header Files in C programming
74
6. F1001 PROGRAMMING FUNDAMENTALS
HEADER LIBRARY USES
FILES FUNCTIONS
stdio.h scanf() Receives input from keyboard
printf() Displays output on screen
gets() Receives input in the form of string
getchar() Receives a character as input
puts() Displays output in string form
math.h pow(x,y) Computes the value of x raised to the power of y
sqrt(x) Computes the square root of x
exp(x) Computes the exponent value of x
ctype.h isalnum(c) To test whether c is alphabetic or digit
isdigit(c) To test whether c is a numeric
ispunct(c) To test whether c is a punctuation mark
islower(c) To test whether c is a lower case character
string.h strlen(c) To get the length of a string
strncmp(c) Compares the part of two strings
strtok(c) Splits string into words
strncpy(c) Copies one part of a chosen string
conio.h clrscr() Clears the output screen
75
7. F1001 PROGRAMMING FUNDAMENTALS
Data and Variables
Data
Data is an array of facts that can be modified by the computer into useful forms for human beings.
76
8. F1001 PROGRAMMING FUNDAMENTALS
NUMERIC INTEGER
All positive and negative numbers including zero and
• Contains all types of no decimal place.
numbers. Example: 0, +1, -10.
• Data which can be used Integers are used to represent the counting of things.
for calculation. Example: Numbers of month in a year (1,2,3…)
• Example: sums of
REAL NUMBER
money, age, and
Contains all real numbers.
distance (e.g: 34, 50,
The number will be stored in floating point.
and 1.01).
Used for metric measurement, temperature and price.
Example: 1.0, 234.55, 20.30, 36.7.
CHARACTER
Consists of all letters, numbers and special symbols.
Characters are surrounded by single quotation mark (‘
‘).
DATA
Example: ‘A’, ‘m’,’=’, ‘#’, ‘1’ or ‘ ‘.
STRING
A combination of one or more characters.
NON NUMERIC A string is surrounded by double quotation marks (“
“).
Example: (“WELCOME TO COSMOPOINT”) or
(“8758”).
LOGICAL VALUES
• Used in making yes-or-no decisions (TRUE-or-
FALSE).
Example: To check 2 integers using If…Else control
structure.
Variables
• A variable is a place to store a piece of information. Just as you might store a friend’s phone
number in your own memory.
• Each variable has:
77
9. F1001 PROGRAMMING FUNDAMENTALS
1. Name
2. Type
3. Holds a value that you assign to them
• Must begin with a letter of the alphabet but, after the first letter,
Naming Variables
it can contain:
1. Letters: A……Z, a……..z
2. Number : 0……9
3. Underscore character: _
• Variable names are case-sensitive (example: the variable
"mYNUMBER" is different from the variable "MYNUMBER").
• Cannot be more than 31 characters.
• Variable names cannot be the same as the C reserved words.
• Variable names cannot have spaces.
Examples : my age count 1 student 10
• Variable names cannot have special characters (typographic
symbols).
Examples : ? / ~ @ + $
Valid Variables Names • Examples : MyAge123, myAGE, My_Age, my_age, NAME,
Name.
• Examples: MY AGE, 4_stu, my age, printf, 81_sales,
Invalid Variable Names Aug91+Sales, Age?
Defining Variables Syntaks : DataType VariableName;
Examples : int number; float money;
Assigning Values To Syntaks : VariableName = Expression
Variables
Examples : number = 32; money = 30.50;
Data Types
• Data type is the type of data that will be stored in the memory location.
DATA TYPE USES EXAMPLE CODE
int int is used to define integer
78
10. F1001 PROGRAMMING FUNDAMENTALS
numbers. int Count;
Count = 5;
float float is used to define floating point
numbers. float Miles;
Miles = 5.6;
double A double is used to define BIG
floating point numbers. It reserves double Atoms;
twice the storage for the number. Atoms= 2500000;
char A char defines characters.
char Letter;
Letter = 'x';
Variable Scope
There are two main variable scopes:
1. Local variable
2. Global variable
Local Variable Global Variable
#include <stdio.h> #include <stdio.h>
FunctionName() char B;
{
int A; FunctionName()
{
/*Block of one or more */ / int A;
*C statements*/
} /*Block of one or more */
/*C statements*/
}
Local Variable
Global
Variable
It is a variable that has been defined A global variable is a variable that has been
immediately after the opening braces of a defined before a function (usually before the
function. main() function).
Each functions can have their own variables This means, all function in that program can
declarations. use this variable.
79
11. F1001 PROGRAMMING FUNDAMENTALS
You can access (and change) local variables Global variables can be used anywhere in
only from the functions in which they are the program as soon as it has been defined.
defined. Therefore that variable's scope is
protected.
All local variables lose their definition when
their block ends.
Character And String Array
• Array is a list of variables or constants, and most programming languages allow the use of such lists.
• A character array is the place to hold strings of information.
• A string is a collection of characters to represent a name
How to define
(mother, father, student, employee, car, building, shopping
strings data type
complex, software), address and extra.
Syntaks:
char variableName [STRING_LENGTH];
Example to declare
char employeeName [30];
character array:
A string must be stored in character arrays, but not all
character arrays contain a string.
string
Contoh :
char name[9] = "Muhammad";
is not the same as
char name[8] = {'M', 'u', 'h', 'a', 'm', 'm', 'a', 'd'};
Data String
Variable Name
Type length
Character array
Constant
80
12. F1001 PROGRAMMING FUNDAMENTALS
• The value of constant remains unchanged for the whole duration of the program execution.
• Every constant has :
1. Name
2. Type
3. Values that are set to them
Syntax : const data_type constant_name = constant_value;
or
#define constant_name constant_value
Examples :
const double PI = 3.1459;
#define PI 3.1459
Character Conversion
• This sign % is known as conversion character in C language.
• Conversion character is used to tell the input function (scanf()) and the output function (printf())
about how the data is being accepted or viewed.
• Examples of usage (input function):
int a; char b; char c[5]; float d;
scanf(“%d”, &a); scanf(“%c”, &b); scanf(“%s”, c); scanf(“%f”, &d);
• Examples of usage (output function) :
printf(“Integer %d”, a); printf(“Aksara Tunggal %c”, b);
printf(“Rentetan %s”, c); printf(“Titik apung %f”, d)
%d decimal integer
%s string
%c character
%e exponential notation floating point number
%f float
%g use the short if %f or %e
%u unsigned integer
%o octal integer
%x hexadecimal integer 81
%% percent sign (%)
13. F1001 PROGRAMMING FUNDAMENTALS
Input And Output
Input Function Output Function
• Use the scanf(), gets(), getc() and • Use the printf(), puts() and putchar()
getchar() function from the stdio.h. function from stdio.h
• One of way to get input is by asking the • This function sends all the output to the
user to enter values into the variables using screen.
the keyboard.
Syntax : printf(“CS”,variablename)
• It contains conversion characters.
• The conversion character explains to C
what data type to be inserted by user.
CS: Control String – a combination of string and
Syntax : scanf(“CC”, &variablename);
conversion character
CC – Conversion Character
#include <stdio.h>
#include <stdio.h> main ()
{
main() int age;
{ /*Input*/
char name [35]; printf(“Your age ?”);
scanf(“%d”, &age);
/*Input*/ /*Output*/
printf(“Enter name :”); printf(“Your age : %d years”, age);
scanf(“%s”, name); }
}
Control String
82