Introduction to Programming - Assignment 1

advertisement
Introduction to Programming
Assignment 1
Q1 Explain data types, Keywords, Constants, Variable in C?
Q2 What are the rules for integer constants, Floating point constants,
constants in C?
Q3) What is the difference between break and continue statement?
Q4) WAP to print prime numbers from 1 to 100.
Q5) WAP to print Fibonacci series and factorial using for loop.
Q6) Explain the concept of looping? How many loops are there in C.
Explain with an example.
Q7) Why Switch Case Default is used in C and how it is different from if
statement?
Q8 ) Why should we avoid goto statement in C?
Q9) WAP to find the reverse of a given integer number.
Q 10) What is the output of this program?
void main() {
int a=b=c=10;
a=b=c=50;
printf(“\n %d %d %d”,a,b,c); }
A] 50 50 50 B] Compile Time Error C] 10 10 10 D] Three Garbage Value
Character
Download