OUTPUTS FOR PROGRAMMING IN C LABORATORY
1(a)
OUTPUT
Enter the upper bound: 1000
The sum of odd numbers is 250000.
The sum of even numbers is 250500.
The absolute difference is 500.
1(b)
OUTPUT
Enter First Number: 25
Enter Second Number: 4
Sum = 29
Difference = 21
Multiplication = 100
Division = 6.250
Square = 625
2(a)
OUTPUT
Enter the values of a,b,c 1 0 -9
The roots of the values a=1,b=0,c=-9 are 3.000000 3.000000
2(b)
OUTPUT
Enter the numbers:3 3
A and B are equal
2(c)
OUTPUT
--MENU--
1 addition
2 subraction
3 multiplication
4 division
0 exit
Enter your choice:1
Enter two number:8 6
Addition :14
3(a)
OUTPUT
Enter the number 5
The factorial of 5 is 120
3(b)
OUTPUT
Enter the number….12321
The sum of the digits of 12321 is 9
The reverse number of the 12321 is 12321
The given number is a palindrom
3(c)
OUTPUT
Enter a number :9..0
Enter a number :8.9
Enter a number :0.0
Sum=17.90
4(a)
OUTPUT
array values [0]=1
array values [1]=2
array values [2]=3
array values [3]=4
array values [4]=5
array values [5]=25
array values [6]=36
array values [7]=49
array values [8]=64
array values [9]=81
4(b)
OUTPUT
enter the 0 student roll no and mark:3977 80
enter the 1 student roll no and mark:17776 95
enter the 2 student roll no and mark:6682 82
enter the 3 student roll no and mark:6683 85
0 students roll no 3977 mark 80
1 students roll no 17776 mark 95
2 students roll no 6682 mark 82
3 students roll no 6683 mark 85
4(c)
OUTPUT
enter the row and columns of A matrix...3 3
enter the rows and columns of B matrix...3 3
enter the elements of A matrix1 2 3 4 5 6 7 8 9
enter the elements of B matrix1 2 3 4 5 6 7 8 9
the elements of A matrix
1 2 3
4 5 6
7 8 9
the elements of B matrix
1 2 3
4 5 6
7 8 9
The multiplication of two matrixes
3 12 27
48 75 108
147 192 243
4(d)
OUTPUT
enter the string...malayalam
9
the given string is a palindrome
5(a)
OUTPUT
enter the string:welcome to c programming
length of main string is 24
5(b)
OUTPUT
enter the first and second string:karthik karthik
the both string is equal
5(c)
OUTPUT
enter the two string:lokesh kanagaraj
concatenated string is....lokeshkanagaraj
6(a)
OUTPUT
enter the two number.....5 6
the addition of two numbers 5 and 6 is 11
6(b)
OUTPUT
Enter the value of x and y
70 50
Before Swapping
x = 70
y = 50
Values of a and b is 50 70
After Swapping
x = 70
y = 50
6(c)
OUTPUT
Enter the Number of Elements in an array : 5
Enter the Array elements
10
30
20
80
60
After Sorting
10
20
30
60
80
6(d)
OUTPUT
Enter number of elements
5
Enter 5 longegers
80
40
60
30
100
Sorted list in ascending order:
30
40
60
80
100
7
OUTPUT
enter the size of the array:5
enter array elements(ascending order):
12345
enter elements to be searched:4
sucessful search.
4 found at position 4.
8(a)
OUTPUT
Enter the employee current salary:10000
Enter bonus:5000
Final salary: 15000
8(b)
OUTPUT
arr[0] = 1
arr[1] = 2
arr[2] = 3
arr[3] = 4
arr[4] = 5
8(c)
OUTPUT
Hello
8(d)
OUTPUT
address of a: 36861d54
address of p: 36861d58
value stored at p: 10
value stored at pp: 10
8(e)
OUTPUT
Value of arr[0] = 10
Value of arr[1] = 20
Value of arr[2] = 30
9(a)
OUTPUT
enter the number 5
fibbonaci series
0 1 1 2 3
9(b)
OUTPUT
Records of STUDENT1:
Id is: 1
Name is: Raju
Percentage is: 90.500000
9(c)
OUTPUT
Enter the name, id, and marks of student 1 karthik 30 95
Enter the name, id, and marks of student 2 ramesh 35 90
Enter the name, id, and marks of student 3 suresh 40 94
Printing the details....
karthik 30 95.000000
ramesh 35 90.000000
suresh 40 94.000000
9(d)
OUTPUT
Enter size of an array1
4
Enter size of an array2
3
Enter numbers for array 1
1
2
3
4
Enter numbers for array 2
3
5
6
Array afetr Union
1
2
3
4
5
6
10(a)
OUTPUT
Enter file name to create :ok.txt
File created successfully.
Data written successfully.Contents of file is :
ABC
10(b)
OUTPUT
Number of characters in file: 3
10(c)
OUTPUT
Hello file by fprintf...
10(d)
OUTPUT
The current position of the file pointer is: 21
The current position of the file pointer is: 0
This is C Programming
10(e)
OUTPUT
value of height : 100
value of number : 3.140000
value of letter : A
value of letter_sequence : ABC
value of backslash_char : ?