You are on page 1of 1

1.

Identifying appropriate data types, variables and simple programs to understand


the basic program. Write a c++ program to find the size of various datatypes.

Output

Size of char : 1
Size of int : 4
Size of short int : 2
Size of long int : 8
Size of float : 4
Size of double : 8
Size of wchar_t : 4

2. Programs for control structures and loops . Write a C++ Program to find
factorial of a number.

Output

Enter a positive integer: 5


Factorial of 5 = 120

3. Simple Programs to construct a class structure with methods and arguments.


Create a structure called person, has char name[50], int age, float salary. In the
main function, set the values of the variables and display the information using
displayData() function.

Output

Enter Full name: Bill Jobs


Enter age: 55
Enter salary: 34233.4

Displaying Information.
Name: Bill Jobs
Age: 55
Salary: 34233.4

You might also like