How to write a C Program String Example in C Programming Language ?
Solution For C Program :
//C Program String Example
#include <stdio.h>
#include <ctype.h>
int main(){
/*
When scanf gets hit
int a;
char s[1000];
scanf("%d ", &a); // Back blank:Cleared away all subsequent whitespace(' ', '\n', '\t')
gets(s);
printf("a: %d\n", a);
printf("s: %s\n", s);
*/
// (1) Blank separated with newline do: scanf("%s", &s);
// (2) Capture an entire row of word: gets(s);
char s[1005];
gets(s);
int i;
for( i = 0 ; s[i] != '\0' ; i++ ){
s[i] = toupper(s[i]);
}
printf("%s", s);
return 0;
}
Program related to C Programming Language :
- C Program Array Index Example
- C Program String - Alphabet Count Example
- C Program Character toupper() Example
- C Program Array Example: Average
- C Program Array Example: Reverse
- C Program if - while - for Example
- C Program Switch - Case Example
- C Program 0.1 + 0.2 != 0.3 Solved
- C Program if - else if - else Example
- C Program typedef Example
- C Program scanf & gets Example
- C Program Friend & Operator: Point2D Example
- C Program Friend & Operator: Vector Example
- C Program Recursion Example
- C Program File Input & Output Example
- C Program Structure Example-2
- C Program Structure Example
- C Program Pointer Example
- C Program Function Example
- C Program String Example
- C Program String Count Example
- C Program String Example
- C Program Character Example
- C Program Sort Example
- C Program sizeof & memcpy Example
- C Program Array Example
- C Program to Array
- C Program print fill zero & mod/div
- C Program Double, Float Equal
- C Program nested for
- C Program for
- C Program if
- C Program System
- C Program Operation
- C Program to printf & scanf
- Example C Program Cuda Malloc
- C Program Side Length
Learn More :
String
- Write a c program to check given string is palindrome number or not.
- C Program to Convert Text String to Binary
- C Program String - Alphabet Count Example
- C Program String Example
- C Program String Count Example
- C Program to Print a String Without Use Semicolon.
- C Program To Find Length Of A String Including Blank Spaces, Tabs, And Other Special Characters
- C Program To Find Length Of String And Concatenate Two Strings
- C Program To Find The Length, Reverse Of A String And To Check It Is Palindrome or Not
- C Program To Print String In Formatted Output Form
- C Program To Reverse The String Using Pointer
- C Program Concatenating Two Strings Into A Third System
- C Program Date from string DDDD-DD-DD
- BUILDS A STRING FROM THE LSB BITS OF EACH PIXEL
- C Program Finds Sub-String Search in String
- C Program to concatenate two strings without using string functions
- C Program to Count Vowels, Consonants and Spaces in a string
- C Program to convert a string to upper case
- C Program Performs a search and replace for a specified target and replacement string
- C Program Anagrams
- C Program to find string length without library function
- C Program to Check Given String is Palindrome or Not
- C Program to Converts a Number to a String.
- Design a C function that shortens a string to 8 characters