Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
vaibhavpatilX authored Jun 22, 2024
1 parent 2cea2af commit 9a3f89e
Show file tree
Hide file tree
Showing 98 changed files with 6,903 additions and 0 deletions.
46 changes: 46 additions & 0 deletions Program123.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
/*
Row = 4
Col = 4
*
* *
* * *
* * * *
*/

#include<stdio.h>

void Display(int iRow, int iCol)
{
int i = 0, j = 0;

if(iRow != iCol)
{
return;
}

for(i = 1; i<= iRow; i++)
{
for(j = 1; j <= i; j++)
{
printf("*\t");
}
printf("\n");
}
}

int main()
{
int iValue1 = 0, iValue2 = 0;

printf("Enter number of rows\n");
scanf("%d",&iValue1);

printf("Enter number of columns\n");
scanf("%d",&iValue2);

Display(iValue1,iValue2);

return 0;
}
21 changes: 21 additions & 0 deletions Program124.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#include<stdio.h>

int main()
{
char ch1 = 'a';
char ch2 = 'A';
char ch3 = '0';

char ch4 = 'z';
char ch5 = 'Z';
char ch6 = '9';

printf("Character represenation is %c and its ASCII value is : %d\n",ch1,ch1);
printf("Character represenation is %c and its ASCII value is : %d\n",ch2,ch2);
printf("Character represenation is %c and its ASCII value is : %d\n",ch3,ch3);
printf("Character represenation is %c and its ASCII value is : %d\n",ch4,ch4);
printf("Character represenation is %c and its ASCII value is : %d\n",ch5,ch5);
printf("Character represenation is %c and its ASCII value is : %d\n",ch6,ch6);

return 0;
}
21 changes: 21 additions & 0 deletions Program125.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#include<stdio.h>

int main()
{
int i = 0;

printf("_________________________________________________\n");
printf("ASCII table\n");
printf("_________________________________________________\n");

printf("Charcter\t Decimal\t Hex \t Octal");

for(i = 0; i <=127; i++)
{
printf("%c \t %d \t %x \t %o\n",i,i,i,i);
}

printf("\n_________________________________________________\n");

return 0;
}
34 changes: 34 additions & 0 deletions Program126.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#include<stdio.h>
#include<stdbool.h>

bool CheckSmall(char ch)
{
if((ch >= 'a') && (ch <= 'z'))
{
return true;
}
else
{
return false;
}
}
int main()
{
char cValue = '\0';
bool bRet = false;

printf("Please enter one character\n");
scanf("%c",&cValue);

bRet = CheckSmall(cValue);
if(bRet == true)
{
printf("%c is a small case letter\n",cValue);
}
else
{
printf("%c is not a small case letter\n",cValue);

}
return 0;
}
34 changes: 34 additions & 0 deletions Program128.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#include<stdio.h>
#include<stdbool.h>

bool CheckSmall(char ch)
{
if((ch>='A') && (ch <= 'Z'))
{
return true;
}
else
{
return false;
}
}
int main()
{
char cValue = '\0';
bool bRet = false;

printf("Please enter one character\n");
scanf("%c",&cValue);

bRet = CheckSmall(cValue);
if(bRet == true)
{
printf("%c is a capital case letter\n",cValue);
}
else
{
printf("%c is not a capital case letter\n",cValue);
}

return 0;
}
34 changes: 34 additions & 0 deletions Program129.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#include<stdio.h>
#include<stdbool.h>

bool IsCapital(char ch)
{
if((ch>=65) && (ch <= 90))
{
return true;
}
else
{
return false;
}
}
int main()
{
char cValue = '\0';
bool bRet = false;

printf("Please enter one character\n");
scanf("%c",&cValue);

bRet = IsCapital(cValue);
if(bRet == true)
{
printf("%c is a capital case letter\n",cValue);
}
else
{
printf("%c is not a capital case letter\n",cValue);
}

return 0;
}
34 changes: 34 additions & 0 deletions Program130.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#include<stdio.h>
#include<stdbool.h>

bool IsDigital(char ch)
{
if((ch>='0') && (ch <= '9'))
{
return true;
}
else
{
return false;
}
}
int main()
{
char cValue = '\0';
bool bRet = false;

printf("Please enter one character\n");
scanf("%c",&cValue);

bRet = IsDigital(cValue);
if(bRet == true)
{
printf("%c is a digit\n",cValue);
}
else
{
printf("%c is not a digit\n",cValue);
}

return 0;
}
34 changes: 34 additions & 0 deletions Program131.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#include<stdio.h>
#include<stdbool.h>

bool IsDigit(char ch)
{
if((ch>=48) && (ch <= 57))
{
return true;
}
else
{
return false;
}
}
int main()
{
char cValue = '\0';
bool bRet = false;

printf("Please enter one character\n");
scanf("%c",&cValue);

bRet = IsDigit(cValue);
if(bRet == true)
{
printf("%c is a digit\n",cValue);
}
else
{
printf("%c is not a digit\n",cValue);
}

return 0;
}
13 changes: 13 additions & 0 deletions Program132.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#include<stdio.h>

int main()
{
char Arr[50];

printf("Please enter your full name : \n");
scanf("%s",Arr);

printf("Your name is : %s\n",Arr);

return 0;
}
15 changes: 15 additions & 0 deletions Program133.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#include<stdio.h>
#include<stdbool.h>

int main()
{
char Arr[50];

printf("Please enter your full name : \n");
//scanf("%s",Arr);
scanf("%[^'\n']s",Arr);

printf("Your name is : %s\n",Arr);

return 0;
}
28 changes: 28 additions & 0 deletions Program134.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#include<stdio.h>

int strlenX(char *str)
{
int iCnt = 0;

while(*str != '\0')
{
iCnt++;
str++;
}
return iCnt;
}

int main()
{
char Arr[20];
int iRet = 0;

printf("Please enter string\n");
scanf("%[^'\n']s",Arr);

iRet = strlenX(Arr);

printf("Number of characters are %d\n",iRet);

return 0;
}
28 changes: 28 additions & 0 deletions Program135.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#include<stdio.h>

int strlenX(char *str)
{
int iCnt = 0,i = 0;

while(str[i] != '\0')
{
iCnt++;
i++;
}
return iCnt;
}

int main()
{
char Arr[10];
int iRet = 0;

printf("Please enter string\n");
scanf("%[^'\n']s",Arr);

iRet = strlenX(Arr); // strlenX(100)

printf("Number of characters are %d\n",iRet);

return 0;
}
28 changes: 28 additions & 0 deletions Program136.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#include<stdio.h>

int strlenX(char str[])
{
int iCnt = 0,i = 0;

while(str[i] != '\0')
{
iCnt++;
i++;
}
return iCnt;
}

int main()
{
char Arr[10];
int iRet = 0;

printf("Please enter string\n");
scanf("%[^'\n']s",Arr);

iRet = strlenX(Arr); // strlenX(100)

printf("Number of characters are %d\n",iRet);

return 0;
}
Loading

0 comments on commit 9a3f89e

Please sign in to comment.