Lect-1
Lect-1
int main(void)
{
int value1, value2, value3;
float sum, average;
comments
Character Data
• All of our programs so far have used
variables to store numbers, not words.
• We can store one or more characters by
writing:
char x, s[10];
– x can hold one and only one character
– s can hold up to nine characters (reserving 1 for
ending null)
• For now, we use character data for input and
output only.
A program that uses a character variable
#include <stdio.h>