answersLogoWhite

0


Best Answer

#include<stdio.h>

#include<conio.h>

void main()

{

char ch;

clrscr();

printf("Enter a Character");

scanf("%c",&ch);

if(ch>=65 && ch<=90)

ch=ch+32;

printf("Upper Case =%c",ch);

getch();

}

User Avatar

Wiki User

14y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

9y ago

You can write a function that does it.

For example:

for( i = 0; i < strlen(string); i++){

if(string[i] >= 'A' && string[i] <= 'Z'){

offset = string[i] - 'A';

string[i] = 'a' + offset;

}

}

This answer is:
User Avatar

User Avatar

Wiki User

13y ago

#include <ctype.h>

void main()

{

char s[30],st[30];

cout<<"enter the string in uppercase\n";

cin.getline(s,30);

int i;

for(i=0;s[i]!='\0';i++)

{

st[i]=tolower(s[i]); // see discussion

}

//st[i]='\0'; // see discussion

cout<<st;

getch();

}

This answer is:
User Avatar

User Avatar

Wiki User

15y ago

Look into the toupper() and tolower() functions. To determine what case it is in, you could use its ASCII value: uppercase is 65 (A) - 90 (Z) and lowercase is 97 - 122.

You can use macros 'isupper' and 'islower' (they are in 'ctype.h' too).

This answer is:
User Avatar

User Avatar

Wiki User

11y ago

#include<stdio.h>

#include<conio.h>

void main()

{

char ch,lower;

printf("Enter a Character\n");

scanf("%c%c",&ch);

if(ch>=65 && ch<=90)

{

ch=ch+32;

printf("\nupper Case =%c",ch);

}

else if(ch>=97 && ch<=122)

{

ch=ch-32;

printf("\nlower Case =%c",ch);

}

getch();

}

This answer is:
User Avatar

User Avatar

Wiki User

11y ago

#include<stdio.h> #include<conio.h> char foo(char a) { if(a>=97 && a<=122) { a = a - 32; return (a); } else { return (a); } } void main() { char a[20],b[20]; int i=0; clrscr(); printf("Please enter a string: "); gets(a); printf("The String in Lower Case is: "); do{ b[i]=foo(a[i]); i++; }while (a[i]!=0); while(i<=20) { b[i]=0; i++; } printf("%s",b); getch(); }

This answer is:
User Avatar

User Avatar

Wiki User

13y ago

as i can do it by adding 32 to the ascii value to each character of given string..

for example:-

void f(char *s)

{

while(s[i]!='\0')

{

s[i]=s[i]+32;

}

}

This answer is:
User Avatar

User Avatar

Wiki User

9y ago

Ggdd

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: C programming to convert upper case string into lower case string and vice versa without using builtin function?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Function of power supply?

to convert AC into DC voltage without fluctuation


Write a Program to convert decimal number into hexadecimal no without using function and string?

This is not a question.


Is it possible to convert a string into integer without using any function in c?

Yes


How do you convert small case to upper case in Excel 2007 without using mouse?

You can use the UPPER function.


How programming language is useful in system programming?

Without programming languages you couldn't write (system) programs.


Is multiprogramming possible without interrupts?

Yes, multi-programming is possible without any interrupts. Provided that a given type of code is properly written then multi-programming is possible without any interrupts.


What is string library functions syntax?

String library function is one which is used to perform an operation in C-programming,without which library functions likestrlen(),strcp(),strcmp(),strdup(),strrev(),etc..,.can be performed


Why should a function or a variable be declared before its first use?

It is somewhat syntax of programming. But when program runs,device known as pre-processor process statements before main function. So when we use that function inside main function it will get idea and run directly without showing any error. So for compilers simplicity and fast execution purpose it is necessary to declare function before its use.


How do you convert a lower level language to a higher level programming language?

You cannot. Conversion is one-way only. It is possible to convert machine code to disassembly, but disassembly is not high-level, it is simply a symbolic representation of the machine code, similar to assembly but without any constants, named variables or comments.


What is important of programming?

Without programming, computers would be expensive doorstops. Computer hardware requires computer software. Programming, even in machine code, is essential in creating that software.


What is the importance of programming?

Without programming, computers would be expensive doorstops. Computer hardware requires computer software. Programming, even in machine code, is essential in creating that software.


What are the purpose of compilers?

When writing a program, you write it in a certain language (java, C++, VB.NET etc.). For the computer to understand that, you need to convert it to computer language. That is what the compiler does.