Learning Material PPS

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

PPS LAB_LEARNING MATERIAL

Area and circumference of the circle. REFER OBSERVATION


Arithmetic expression REFER OBSERVATION
Ternary Operator REFER OBSERVATION
Quadratic equation. REFER OBSERVATION
Given number is positive or negative. REFER OBSERVATION
Factorial REFER OBSERVATION
Fibonacci REFER OBSERVATION
Addition of two matrices REFER OBSERVATION
sum of natural numbers using array REFER OBSERVATION
String Compare OUTPUT:
#include<stdio.h>
#include<string.h>
int main()
{
char a[100], b[100];
printf("Enter the first string\n"); Enter the first string
gets(a); deep learning
printf("Enter the second string\n"); Enter the second string
gets(b); deep learning
if( strcmp(a,b) == 0 ) Entered strings are equal.
printf("Entered strings are equal.\n");
else
printf("Entered strings are not equal.\n");
return 0;
}

STRING COPY OUTPUT:


#include <stdio.h> Enter the string
#include <string.h> hi all
int main() string: hi all
{ Copied string: hi all
char A[100], copy[100];
printf("Enter the string\n");
gets(A);
strcpy(copy, A);
printf("string: %s\n", A);
printf("Copied string: %s\n", copy);
return 0;
}
STRING LENGTH OUTPUT:
#include <stdio.h> Length of the string: 23
int main() {
char s[] = "Artificial Intelligence";
int i;
for (i = 0; s[i] != '\0'; ++i);
printf("Length of the string: %d", i);
return 0;
}
To find square, square root, log, exponential using in-built functions REFER OBSERVATION
print the first and rows of triangle Enter number of rows: 3
#include <stdio.h> *
int main() **
{ ***
int i, j, rows;
printf("Enter number of rows: ");
scanf("%d",&rows);
for(i=1; i<=rows; ++i)
{
for(j=1; j<=i; ++j)
{
printf("* ");
}
printf("\n");
}
return 0;
}
Square of integer from 1 to 100. REFER OBSERVATION
Basic functions of file handling. REFER OBSERVATION

You might also like