Software Testing Manual Record (3 Year)
Software Testing Manual Record (3 Year)
DATE:
#include<stdio.h>
int main() {
scanf("%ld", &num);
while(num / 10 != 0)
sum = 0;
while(num != 0)
num = sum;
printf("%d", sum);
return 0;
}
Expected Output:
1st run:
2nd run:
DATE:
#include<stdio.
h>
#include<conio.h>
main()
{
int s1,s2,s3;
printf("Enter marks of
sub1,sub2,sub3");
scanf("%d%d%d",&s1,&s2,&s3);
if(s1>40 && s2>40 && s3>40)
{
printf("Pass");
}
else
{
printf("Fail");
}
}
OUTPUT:
EX.NO :3
Generating n prime numbers
DATE:
#include<stdio.h>
void main()
int i,j,n;
scanf("%d",&n);
for(i=2;i<=n;i++)
int c=0;
for(j=1;j<=i;j++)
{
if(i%j==0)
c++;
if(c==2)
printf("%d ",i);
Output
EX.NO:4 Stack using array implementation
DATE:
#include <limits.h>
#include <stdio.h>
#include <stdlib.h>
struct Stack {
int top;
int capacity;
int* array;
};
stack->capacity = capacity;
stack->top = -1;
stack->array
= (int*)malloc(stack->capacity * sizeof(int));
return stack;
if (isFull(stack)) {
printf("Overflow\n");
return;
stack->array[++stack->top] = item;
{
if (isEmpty(stack)) {
printf("Underflow\n");
return INT_MIN;
return stack->array[stack->top--];
if (isEmpty(stack)) {
printf("Stack is empty\n");
return INT_MIN;
return stack->array[stack->top];
if (isEmpty(stack)) {
printf("Stack is empty\n");
else {
printf("%d\n", stack->array[i]);
}
}
int main()
push(stack, 1);
push(stack, 2);
push(stack, 3);
display(stack);
return 0;
Output
1 pushed to stack
2 pushed to stack
3 pushed to stack
3 popped from stack
Top element is 2
Elements present in stack:
2
1
EX.NO: Menu-driven option for queue OPERATIONS
DATE:
#include<stdio.h>
#include<stdlib.h>
#define MAX 10
int queue_arr[MAX];
int rear=-1;
int front=-1;
int del();
int peek();
void display();
int isFull();
int isEmpty();
int main()
int choice,item;
while(1)
{
printf("\n1.Insert\n");
printf("2.Delete\n");
printf("5.Quit\n");
scanf("%d",&choice);
switch(choice)
case 1:
scanf("%d",&item);
insert(item);
break;
case 2:
item=del();
break;
case 3:
break;
case 4:
display();
break;
case 5:
exit(1);
default:
printf("\nWrong choice\n");
}/*End of switch*/
}/*End of while*/
return 0;
}/*End of main()*/
if( isFull() )
{
printf("\nQueue Overflow\n");
return;
if( front == -1 )
front=0;
rear=rear+1;
queue_arr[rear]=item ;
}/*End of insert()*/
int del()
int item;
if( isEmpty() )
printf("\nQueue Underflow\n");
exit(1);
item=queue_arr[front];
front=front+1;
return item;
}/*End of del()*/
int peek()
if( isEmpty() )
printf("\nQueue Underflow\n");
exit(1);
return queue_arr[front];
}/*End of peek()*/
int isEmpty()
return 1;
else
return 0;
}/*End of isEmpty()*/
int isFull()
{
if( rear==MAX-1 )
return 1;
else
return 0;
}/*End of isFull()*/
void display()
int i;
if ( isEmpty() )
printf("\nQueue is empty\n");
return;
printf("\nQueue is :\n\n");
for(i=front;i<=rear;i++)
printf("%d ",queue_arr[i]);
printf("\n\n");
OUTPUT : :
1.Insert
2.Delete
5.Quit
1.Insert
2.Delete
5.Quit
1.Insert
2.Delete
5.Quit
1.Insert
2.Delete
5.Quit
1.Insert
2.Delete
5.Quit
Queue is :
1 2 3 4
1.Insert
2.Delete
5.Quit
2.Delete
5.Quit
Deleted element is 1
1.Insert
2.Delete
5.Quit
Deleted element is 2
1.Insert
2.Delete
5.Quit
Deleted element is 3
1.Insert
2.Delete
5.Quit
Deleted element is 4
1.Insert
2.Delete
5.Quit
Queue Underflow
EX .NO: PALINDROME
DATE:
#include <stdio.h>
++ptr;
--ptr;
if (*ptr == *rev) {
--ptr;
rev++;
else
break;
printf("String is Palindrome");
else
int main()
{
char str[1000] = "madam";
isPalindrome(str);
return 0;
Output
String is Palindrome