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 / 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 |
How can you be sure that a program follows the ANSI C standard?
Explain what is operator promotion?
What is the code in while loop that returns the output of given code?
program to find the ASCII value of a number
What is the use of define in c?
How can you print HELLO WORLD without using "semicolon"?
write a pgm to print 1 1 2 1 1 2 3 2 1 1 2 3 4 3 2 1
How can I sort a linked list?
How can I prevent other programmers from violating encapsulation by seeing the private parts of my class?
Reverse the bit order in a single macro. eg. i/p = 10010101 --> o/p = 10101001
Write a simple program to find the size of different basic data types in C.
What is indirection in c?