-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2cea2af
commit 9a3f89e
Showing
98 changed files
with
6,903 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} |
Oops, something went wrong.