uppercase

1
//TO UPPERCASE THE STRING USING POINTERS #include<iostream.h> #include<stdio.h> #include<conio.h> void upper(char*) void main() { clrscr(); char str[25]; int len, i=0; cout<<”Enter the string”; gets(str); upper(str); cout<<”\n Your string in Uppercase”<<str; } void upper(char *str1) { while(*str1!=’\0’) { if(*str1>96 && *str<123) { *str1=*str1-32; str1++; }} OUTPUT :- Enter the string i Am Utsav Your string inUppercase I AM UTSAV

Upload: rishabh-sharma

Post on 23-Oct-2015

2 views

Category:

Documents


0 download

DESCRIPTION

c++ program to convert lowercase alphabets to uppercase

TRANSCRIPT

Page 1: Uppercase

//TO UPPERCASE THE STRING USING POINTERS

#include<iostream.h>#include<stdio.h>#include<conio.h>

void upper(char*)

void main(){clrscr();char str[25];int len, i=0;cout<<”Enter the string”;gets(str);upper(str);cout<<”\n Your string in Uppercase”<<str;}void upper(char *str1){while(*str1!=’\0’){if(*str1>96 && *str<123){*str1=*str1-32;str1++;}}

OUTPUT :-Enter the string i Am UtsavYour string inUppercase I AM UTSAV