You are on page 1of 2

C Programming

UNIT-1
1) List out the program development steps to solve a problem?
ANS:
i) Problem definition.
ii) Problem analysis.
iii) Algorithm development.
iv) Coding & documentation.
v) Testing and debugging.
vi) Maintenance.
i) Problem definition:
In this phase we define, the problem statement and we decide the boundaries of the
problem. In this phase, we need to understand the problem statement, what is our
requirement, what should be the output of the problem solution.
ii) Problem analysis:
In this phase, we determine the requirements like Variables, functions, Etc.. to solve the
problem.
iii) Algorithm development:
During this phase, we develop a step by step procedure to solve the problem. This phase
is very important for program development.
iv) Coding & Documentation:
This phase uses a programming language to write or implement the actual programming
instructions for the steps defined in the previous phase.
v) Testing & Debugging:
During this phase, we check whether the code written in the previous stage is solving
the specified problem or not.
vi) Maintenance:
During in the phase, the program is actually used by the users. If any enhancements
found in this phase all the phases are to be repeated to make the enhancements.
2) Write a C program to print 1 to N Natural numbers.
Program:
#include<stdio.h>
#include<conio.h>
void main()
{
int i, N;
printf("Enter the value of N:\t");
scanf("%d", &N);
printf("Printing natural numbers from 1 to %d\n", N);
for(i = 1; i <= N; i++)
{
printf("%d\n", i);
}
printf("\n");
getch();
}
Output:

You might also like