Sie sind auf Seite 1von 9

1.

 Object code is the output of a compiler after it processes source code.


 Compiler is the Programming language processor that translates a program written in a high-
level language (the 'source program') which humans can understand, into machine language
program (the 'object program') which the computers can understand

2.

 The reference operator noted by ampersand ("&"), is also a unary operator in c


languages that uses for assign address of the variables.
 The dereference operator or indirection operator, noted by asterisk ("*"), is also a
unary operator in c languages that uses for pointer variables.
3.

 A parameter is a variable in a method definition.


 When a method is called, the arguments are the data you pass into the
method's parameters.
 Parameter is variable in the declaration of function.
 Argument is the actual value of this variable that gets passed to function.
4.

 Strings are defined as an array of characters.


 strcpy,strlen,strcat,strcmp,strchr

5.

 void abc(int *x, char *y) {

double d;

d = *x

return d;

6.

 When we define a pointer to pointer, the first pointer is used to store the address of second pointer
so that is double pointer.

7.

 The break statement terminates the loop (for, while and do...while loop)
immediately when it is encountered. Its syntax is: break;

 The continue statement skips statements after it inside the loop. Its syntax is: continue;
8.

 Null character is a character that has all its bits set to 0. A null character, therefore, has a
numeric value of 0, but it has a special meaning when interpreted as text. In C, a null
character is used to mark the end of a character string.

9.

 The difference is puts is used to display only strings. However, printf is used to display integer,
float, character, hexa decimal values as well as strings.scanf() is used to read input of any
datatype while gets is used only for string input.

10.

 The output will be 4.


11.

SDLC Phases
Given below are the various phases of SDLC:
 Requirement gathering and analysis
 Design
 Implementation or coding
 Testing
 Deployment
 Maintenance
#1) Requirement Gathering and Analysis
During this phase, all the relevant information is collected from the customer to develop a
product as per their expectation. Any ambiguities must be resolved in this phase only.
Business analyst and Project Manager set up a meeting with the customer to gather all the
information like what the customer wants to build, who will be the end user, what is the
purpose of the product. Before building a product a core understanding or knowledge of the
product is very important.

#2) Design
In this phase, the requirement gathered in the SRS document is used as an input and
software architecture that is used for implementing system development is derived.

#3) Implementation or Coding


Implementation/Coding starts once the developer gets the Design document. The Software
design is translated into source code. All the components of the software are implemented
in this phase.

#4) Testing
Testing starts once the coding is complete and the modules are released for testing. In this
phase, the developed software is tested thoroughly and any defects found are assigned to
developers to get them fixed.

Retesting, regression testing is done till the point at which the software is as per the
customer’s expectation. Testers refer SRS document to make sure that the software is as
per the customer’s standard.

#5) Deployment
Once the product is tested, it is deployed in the production environment or first UAT (User
Acceptance testing) is done depending on the customer expectation.
In the case of UAT, a replica of the production environment is created and the customer
along with the developers does the testing. If the customer finds the application as
expected, then sign off is provided by the customer to go live.

#6) Maintenance
After the deployment of a product on the production environment, maintenance of the
product i.e. if any issue comes up and needs to be fixed or any enhancement is to be done
is taken care by the developers.

12


#include<stdio.h>
#include<conio.h>

void main()
{
int a[50];
int n,i,small,s_small;
clrscr();
printf("\n Enter number of elements: ");
scanf("%d",&n);

printf("\n Enter %d elements: ",n);


for(i=0;i<n;i++)
{
scanf("%d",&a[i]);
}

small=s_small=a[0];

for(i=1;i<n;i++)
{
if(small>a[i])
{
s_small=small;
small=a[i];
}
else if(s_small>a[i] && a[i]!=small)
{
s_small=a[i];
}
}

printf("\n The Second Smallest Element in the given Array: %d", s_small);
getch();
}

13
 /* C program to find all prime numbers from the inputted array */
#include<stdio.h>
#include<conio.h>
void main()
{
int ar[100],i,n,j,counter;

printf("Enter the size of the array ");


scanf("%d",&n);
printf("\n Now enter the elements of the array");
for(i=0;i<n;i++)
{
scanf("%d",&ar[i]);
}

printf(" Array is -");


for(i=0;i<n;i++)
{
printf("\t %d",ar[i]);
}
printf("\n All the prime numbers in the array are -");
for(i=0;i<n;i++)
{
counter=0;
for(j=2;j<ar[i];j++)
{
if(ar[i]%j==0)
{
counter=1;
break;
}
}
if(counter==0)
{
printf("\t %d",ar[i]);
}
}
getch();
}

14.

/* C program to Toggle Case of all Characters in a String */

#include <stdio.h>
#include <string.h>

int main()
{
char Str1[100];
int i;

printf("\n Please Enter any String to Toggle : ");


gets(Str1);

for (i = 0; Str1[i]!='\0'; i++)


{
if(Str1[i] >= 65 && Str1[i] <= 90)
{
Str1[i] = Str1[i] + 32;
}
else if(Str1[i] >= 97 && Str1[i] <= 122)
{
Str1[i] = Str1[i] - 32;
}
}

printf("\n The Given String after Toggling Case of all Characters = %s", Str1);

return 0;
}
15.

#include <stdio.h>
#include <string.h>

int main()
{
char a[100], b[100];

printf("Enter a string to check if it is a palindrome\n");


gets(a);

strcpy(b, a); // Copying input string


strrev(b); // Reversing the string

if (strcmp(a, b) == 0) // Comparing input string with the reverse string


printf("The string is a palindrome.\n");
else
printf("The string isn't a palindrome.\n");

return 0;
}

16.

#include <stdio.h>

int main()
{
int m, n, p, q, c, d, k, sum = 0;
int first[10][10], second[10][10], multiply[10][10];

printf("Enter number of rows and columns of first matrix\n");


scanf("%d%d", &m, &n);
printf("Enter elements of first matrix\n");

for (c = 0; c < m; c++)


for (d = 0; d < n; d++)
scanf("%d", &first[c][d]);

printf("Enter number of rows and columns of second matrix\n");


scanf("%d%d", &p, &q);

if (n != p)
printf("The matrices can't be multiplied with each other.\n");
else
{
printf("Enter elements of second matrix\n");

for (c = 0; c < p; c++)


for (d = 0; d < q; d++)
scanf("%d", &second[c][d]);

for (c = 0; c < m; c++) {


for (d = 0; d < q; d++) {
for (k = 0; k < p; k++) {
sum = sum + first[c][k]*second[k][d];
}

multiply[c][d] = sum;
sum = 0;
}
}

printf("Product of the matrices:\n");

for (c = 0; c < m; c++) {


for (d = 0; d < q; d++)
printf("%d\t", multiply[c][d]);

printf("\n");
}
}

return 0;
}

17.

The call by reference method of passing arguments to a function copies the address of an
argument into the formal parameter. Inside the function, the address is used to access the
actual argument used in the call. It means the changes made to the parameter affect the
passed argument. To pass a value by reference, argument pointers are passed to the
functions just like any other value.

#include <stdio.h>
#include <conio.h>
int find_largest(int [],int);
int main()
{
int arr[30],size,largest,i;
printf("Enter the size of the array maximum up to 30: ");
scanf("%d",&size);
printf("Enter the %d integer numbers: ",size);
for(i=0;i<size;i++)
scanf("%d",&arr[i]);
largest = find_largest(arr,size);
printf("\nThe largest element is: %d\n",largest);
return 0;
getch();
}
int find_largest(int arr1[],int size1)
{
int temp_larg,i;
temp_larg=arr1[0];
for(i=1;i<size1;i++)
{
if(arr1[i]>temp_larg)
temp_larg=arr1[i];
}
return(temp_larg);
}

Das könnte Ihnen auch gefallen