It18111 - Programming For Problem Solving Laboratory EX - NO:5.a Date
It18111 - Programming For Problem Solving Laboratory EX - NO:5.a Date
EX.NO:5.a
DATE:
Simple programming for one dimensional and two dimensional arrays.
QUESTION:
Chandler is assigned a new task today. He is given an array A containing N integers. His task is to
update all elements of array to some minimum value x , that is, A[i]=x, 1<=i<=N ; such that sum of
this new array is strictly greater than the sum of the initial array. Note that x should be as minimum
as possible such that sum of the new array is greater than the sum of the initial array.
Input Format:
First line of input consists of an integer N denoting the number of elements in the array A.
Second line consists of N space separated integers denoting the array elements.
Output Format:
The only line of output consists of the value of x.
Input Constraints:
1 <= N <= 10 power 5
1 <= A[i] <= 1000
AIM:
ALGORITHM:
RESULT:
EX.NO:5.b
QUESTION:
Array count is a program that is supposed to return the number of elements in the input array arr
which are greater than twice the input number n. Write a C program to implement the same.
AIM:
ALGORITHM:
PROGRAM:
RESULT:
EX.NO:5.c
DATE:
Simple programming for one dimensional and two dimensional arrays.
ALGORITHM:
PROGRAM:
#include<stdio.h>
void main()
{
RESULT:
EX.NO:5.d
DATE:
Simple programming for one dimensional and two dimensional arrays.
QUESTION:
The teacher of a class decided to make a game for the students to find the fast computing person
in the class. The game was to find the diagonal difference of the matrix and shout the absolute
AIM:
ALGORITHM:
PROGRAM:
#include<stdio.h>
#include<stdlib.h>
void main()
{
int a[10][10],m,n,i,j,x=0,y=0;
printf("Enter the dimensions");
scanf("%d%d",&m,&n);
RESULT: