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 does c mean in standard form?
Can you mix old-style and new-style function syntax?
What is the most efficient way to count the number of bits which are set in an integer?
Is fortran still used today?
Explain the use of 'auto' keyword
How can a program be made to print the line number where an error occurs?
why use functions a) writing functions avoids rewriting the same code over and over b) using functions it becomes easier to write programs and keep track of what they are doing c) a & b d) none of the above
What are the uses of null pointers?
What does == mean in texting?
Is struct oop?
What is the difference between struct and union in C?
A text file that contains declarations used by a group of functions,programs,or users a) executable file b) header file c) obj file d) .cfile
all c language question
What is New modifiers?
Explain built-in function?