Assignment 2
Assignment 2
Basic instructions:
1. Never copy and paste. Always start from the scratch and
write each line of code by yourself only.
2. Add comments in every program. Do not copy and paste the
comments.
3. Every day complete your assignment.
4. Check every line of your program for semicolon (;). In C
program, the semicolon is a statement terminator. That is,
each individual statement must end with a semicolon.
5. Follow the following outline for your programs.
/* Add your comments here
Author:
Date:
Aim:
Language:
*/
------------------------------------------------------------------------------------
1. Write a C program that does the following task.
Add comments
Declare the following variables and check for valid and
invalid variables.
int a;
int 0a;
wrong
int ZeroNumber;
int _first;
int 009;
wrong bcoz no.
int year@22;
wrong bcoz @ is special symbol secial symbol not
allowed in identifier
int sept21;
int YahooGoogle;
{int else;
int int;
int float;
int double;
int char;
int intOne;}
none will work as they are datatypes are reseved
words