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
What is the difference between ++a and a++?
How many types of operators are there in c?
What is use of #include in c?
What are the different types of control structures?
What are the advantages of c preprocessor?
What is the best way of making my program efficient?
ATM machine and railway reservation class/object diagram
Explain what could possibly be the problem if a valid function name such as tolower() is being reported by the c compiler as undefined?
Can we add pointers together?
Explain what are the standard predefined macros?
Why & is used in c?
What is hungarian notation? Is it worthwhile?
Are there any problems with performing mathematical operations on different variable types?
What are the different types of constants?
How does #define work?