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 a volatile keyword in c?
Compare array data type to pointer data type
Write a C Program That Will Count The Number Of Even And Odd Integers In A Set using while loop
Explain the use of keyword 'register' with respect to variables.
Why array is used in c?
What is meant by type specifiers?
What are near, far and huge pointers?
What is use of #include in c?
Which is best linux os?
What is the use of extern in c?
What is the most efficient way to count the number of bits which are set in an integer?
Can we use visual studio for c?
a construct the"else" part of "if" statement contains anoth "if else" statement is called a) if-else b) else-if-else c) if-else-if-else d) chain if/if-else-if
What are the 5 organizational structures?
what are # pragma staments?