Beruflich Dokumente
Kultur Dokumente
TOPIC OF EXPERIMENT-
AIM OF THE
EXPERIMENT-
i Name (string)
ii Age (integer)
**************STUDENT DATABASE*******************
SUBJECT NAME-Problem Solving with Programming Lab SUBJECT CODE-20CSP112
Enter name in capital letters: xyz pqr
Enter age : 18
************************************************************
FLOWCHART/ ALGORITHM-
1. START
2. declare the values to be assigned like Name, age etc.
3. Define values to the given to the values.
4. Add values
5. Print C
6. STOP
PROGRAM CODE-
#include <stdio.h>
int main()
char name[20];
int age;
float perc;
SUBJECT NAME-Problem Solving with Programming Lab SUBJECT CODE-20CSP112
scanf("%s", name);
scanf("%lld", &contact_num);
scanf("%f", &perc);
return 0;
1. Syntax errors: errors due to the fact that the syntax of the language is not
respected (2 times).
2. Semantic errors: errors due to an improper use of program statements (1time).
SUBJECT NAME-Problem Solving with Programming Lab SUBJECT CODE-20CSP112
3. Logical errors: errors due to the fact that the specification is not respected (3
times).
4. Compile time errors: syntax errors and static semantic errors indicated by the
compiler (5 times).
SCANF FUNCTION- The scanf function allows you to accept input from standard in,
which for us is generally the keyboard. The scanf function can do a lot of different
things, but can be unreliable because it doesn’t handle human errors very well.
scanf("%d", &b);
Int a=10;
double d=13.4;
printf("%f%d",d,a);
4. Total Marks 30