Pps Assignment (21cse38)
Pps Assignment (21cse38)
NAME-ROHIT KUMAR
ROLL NO-21cse38
BRANCH-CSE
SUBJECT-PPS
Sol:- #include<stdio.h>
#include<conio.h>
int main()
char ch;
printf("Enter an alphabet:");
scanf("%c", &ch);
printf("%c is Vowel.",ch);
else
printf("%c is Consonant.",ch);
return 0;
Output:-
Q2.Write a C program to find the largest number among three numbers?
int main()
int a, b, c;
&c);
%d, %d and %d
consecutively.\n", a, b, c);
if (a > b)
if (a > c)
printf("The Largest
}
else
printf("The Largest
else
if (b > c)
printf("The Largest
else
printf("The Largest
return 0;
Output:-
Q3.Write a C program to check whether a number is positive or negative?
int main()
int a;
printf("Enter an integer:");
scanf("%d",&a);
%d\n",a);
if (a>0)
printf("%d is a positive
integer.",a);
else
printf("%d is a negative
integer.",a);
return 0;
Output:-
Q4. Write a program to check whether a string is a palindrome or not?
#include <string.h>
int main()
int l, i, n = 0;
char ch[100];
case: ");
scanf("%s", &ch);
l = strlen(ch);
n++;
will exceed.
if (n == i)
{
printf("%s is
palindrome.", ch);
else
printf("%s is not
palindrome.", ch);
return 0;
Output:-
int main()
int n, sum;
number: ");
scanf("%d", &n);
printf("%d", sum);
return 0;
0utput:-