answersLogoWhite

0


Best Answer

#include<stdio.h> int main() { char str[100]; int i; printf("Please enter a string: "); // gets(str); // fgets is a better option over gets to read multiword string . fgets(str, 100, stdin); // Following can be added for extra precaution for '\n' character // if(str[length(str)-1] == '\n') str[strlen(str)-1]=NULL; for(i=0;str[i]!=NULL;i++) { if(str[i]>='A'&&str[i]<='Z') str[i]+=32; else if(str[i]>='a'&&str[i]<='z') str[i]-=32; } printf("String in toggle case is: %s",str); return 0; }

User Avatar

Wiki User

11y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How do you toggle case of string in c code. Example is TogGle will turn into tOGgLE?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What does a toggle switch do?

Toggle = back and forth, or on and off. A toggle switch toggles (turns) a light or other device on or off. Good example is a light switch (the wall kind)-- a toggle switch must also be of the "throw the stick back and forth" kind. Which a light switch basically is.


What is the word toggle plural?

The noun toggle is the singular form; the plural form is toggles.


What a toggle?

A toggle is a metal or wooden pin or rod, or similar, which helps you to secure things.


Why T filp flop is called toggle flip flop?

Because 'T' stands for 'Toggle'


How do you sew on toggle buttons?

The way to sew on a toggle button is to first pin the toggle button in place on the jacket. Next, take a threaded needle and knot it tightly. Insert the threaded needle through the loop in the toggle at least four or five times, securing the know underneath the fabric. Tie and knot and the toggle should be in place.


What is toggle bit?

when dealing with bit, there are only 2 bits which are '0' and '1'. when the current bit is '0', if we toggle this bit, it will become '1' and when the current bit is '1', if we toggle this bit, it will become '0' that is


How would you wire a toggle switch for your starter in a 1977 Chevy truck?

you can just use a toggle switch,,,you need a relay capable of the amps it takes for the starter.it would connect between the starter and the battery,then you would need a toggle switch preferably a momatary toggle switch to activate the relay.


How do you replace window toggle switch 1999 Buick century?

how to replace window toggle switch 1999 buick century


What is a synonym for toggle?

Synonyms for toggle: adjuster, dial, knob, on/off, power switch, switch, tuner, push button


What is a carved toggle in japan?

netsuke


What is the toggle of the insert key?

Overtype


What is is faster synchronous slc NAND flash or toggle MLc NAND flash?

Toggle is the fastest type of MLC NAND by a considerable margin. There is a larger performance gap between toggle and synchronous than there is between synchronous and asynchronous.