Read N characters in to an array . Use functions to do all
problems and pass the address of array to function.

1. Print only the alphabets . If in upper case print in
lower case vice versa.

Answer Posted / vignesh1988i

#include<stdio.h>
#include<conio.h>
void fun(char *);
void main()
{
char a[50];
printf("enter the characters :");
gets(a);
fun(&a);
getch();
}
void fun(char *a)
{
char c;
for(int i=0;a[i]!='\0';i++)
{
if(a[i]>=97&&a[i]<=122)
{
c=a[i]-32;
printf("%c",c);
}
else if(a[i]>=65&&a[i]<=90)
{
c=a[i]+32;
printf("%c",c);
}
else if(a[i]==' ')
countine;
}
}

Is This Answer Correct ?    3 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the difference between ++a and a++?

698


How many types of operators are there in c?

620


What is use of #include in c?

601


What are the different types of control structures?

588


What are the advantages of c preprocessor?

714






What is the best way of making my program efficient?

572


ATM machine and railway reservation class/object diagram

4806


Explain what could possibly be the problem if a valid function name such as tolower() is being reported by the c compiler as undefined?

586


Can we add pointers together?

621


Explain what are the standard predefined macros?

654


Why & is used in c?

715


What is hungarian notation? Is it worthwhile?

700


Are there any problems with performing mathematical operations on different variable types?

576


What are the different types of constants?

641


How does #define work?

651