C Programming: Kireshvanth.B 20Z326
C Programming: Kireshvanth.B 20Z326
B
Roll no : 20Z326
C PROGRAMMING
9.28 ) Describe the array that is defined in each of the following
statements. Indicate what values are assigned to the individual array
elements.
Solutions:
a) c is a floating point and one dimensional array.
The elements in the array c are:
c[0]=2.
c[1]=5.
c[2]=3.
c[3]=-4.
c[4]=12.
c[5]=12.
c[6]=0.
c[7]=8.
Output:
20
Finding the sum of even numbers in the array.
b)
Output :
25
Finding the sum of odd numbers in the array.
c)
Output :
45
Finding the sum of all elements in the array.
d)
Output :
25
Finding the sum of odd numbers in the array, which is
initialized externally.
e)
Output :
1
Finding the smallest value .
f)
Output :
159
Finding the smallest value in each row.
g)
Output :
9 10 11 12
Finding the largest value in each column.
h)
Output :
0224
4668
8 10 10 12
Finding an odd element and reducing its value by 1 and
printing the other elements as such in array.
i)
Output :
PPoorrmmiiggwwtt aa eeggeettffnn
Printing the odd numbered array twice by skipping the
even numbered array.
Source Code:
#include <stdio.h>
#include <string.h>
int main()
{
char s[80];
strrev(s);
Output :
On using recursion the program runs faster and uses less
memory allocations.
9.43.
Source Code :
#include<stdio.h>
#include<math.h>
void equ(int a);
int main(){
int t;
printf("Enter the value of t : ");
scanf("%d",&t);
}
Output :