SCHOOL OF CODE BUILDERS
Learn To CODE. Become A DEVELOPER.
Pages
HOME
DATA STRUCTURES
STRINGS
ARRAYS
MATRIX
BINARY TREES
LINKED LIST
STACK
QUEUE
SORTING
SEARCHING
C
PYTHON
PSEUDOCODE
CONTEST PROBLEMS
ALGORITHMS
PATTERNS
PHP
C PUZZLES
C INTERVIEW QUESTIONS
JAVA
C++
HASHING
RECURSION
BASIC C PROGRAMS
TCS-CODEVITA
FACEBOOK
CONTACT US
C program to print capital letters
C program to print capital letters
Output:
Enter the string to find capital letters in it:
CodeRegister
The capital letters in the string are:
C R
Implementation:
#include
#define MAX 1000 /* set the size of the string here */ int main(void) { char s[MAX]; int i=0,flag=1; printf("Enter the string to find capital letters in it:\n"); scanf("%s",s); printf("The capital letters in the string are:\n"); while(s[i]) { if(s[i]>='A' && s[i]<='Z') { printf("%c ",s[i]); flag=0; } i++; } if(flag) printf("Sorry! No capital letters found in your string\n"); return 0; }
PREVIOUS
NEXT
HOME