Sie sind auf Seite 1von 17

c++ programs class 11

Ratings: (0)|Views: 2,275 |Likes: 1


Published by alokkumar012345
C++ programs of class 11 cbse for project submission. Includes programs of all capters
of sumita arora .
See more
#include<string.h>void main(){int n, n1, n2=n,
rev=0;cout<<"Enter any number: ";cin>>n;while(n){n1=n%10;rev=rev*10+n1;n=n/10;}if(n2==r
ev)cout<<"\nNumber is palindrome";elsecout<<"\nNumber is not palindrome";}
OUTPUT
Enter any number: 121Number is palindrome
39. Program to check whether entered character is analphabet or not.

#include<iostream.h>#include<ctype.h>void main(){char ch;cout<<"Enter character


:";cin>>ch;if(isalpha(ch))cout<<"It is an alphabet.";elsecout<<"It is not an alphabet.";}
OUTPUT
Enter character: aIt is an alphabet.Enter character: %It is not an alphabet.
40. Program to check whether the entered character isof uppercase or lowercase.
#include<iostream.h>

#include<ctype.h>void main(){ char ch;cout<<"Enter


character:";cin>>ch;if(isalpha(ch)){ cout<<"It is an alphabet.\n";if(isupper(ch))cout<<"It is an
upper case.";elsecout<<"It is a lower case.";}elsecout<<"It is not an alphabet.";}
OUTPUT
Enter character: rIt is an alphabet.It is a lower case.
41. Program to concatenate two strings.
#include<iostream.h>#include<stdio.h>

#include<string.h>void main(){char s1[10], s2[10];cout<<"Enter string


1:";gets(s1);cout<<"Enter string 2:";gets(s2);cout<<strcat(s1,s2);}
OUTPUT
Enter string 1: GOODEnter string 2: LUCKGOODLUCKEnter string 1: WELEnter string 2:
COMEWELCOME
42. Program to find out number of words present in aline.
#include<iostream.h>#include<string.h>

void main(){int n=1;char str[100];cout<<"Enter line:";cin.getline(str,100);for(int i=1; str[i]!='\0';


i++){if ( str[i-1]!=' ' && str[i]==' ')n=n+1;}cout<<

\
nNumber of words = <<n
;}
OUTPUT
Enter line: My name is Alok Kumar.Number of words = 5Enter line: Program to find out number
of words present in a line.Number of words = 11
43. Program to print a word by deleting 1 letter fromend in each turn.
#include<iostream.h>#include<string.h>void main()

{ char str[25];cout<<"Enter string:";cin.getline(str,25);int len=strlen(str);for(int i=len; i<=0; i-){ for(int j=0; j<=i; j++)cout<<str[j];
cout<<
\
n;
}}
OUTPUT
Enter string: HELLOHELLOHELLHELHEH
44. Program to check whether the given string is
palindrome
or not.
#include<iostream.h>#include<string.h>void main(){ char str[20];

Activity (3)

FILTERS
Add to collectionReviewAdd NoteLike
1 thousand reads
1 hundred reads

Ankit Rohilla liked this


Similar to c++ programs class 11
list of C++ program using function class XI
KANCHAN KHURANA

C++ Programs
RAGHUNATH2U

CBSE Class XI Computer Science Notes


EXPERTARJUN

C++ Programs Collection


NEIL MAHASETH

CLASS XI COMPUTER SCIENCE PAPER FOR HALF YEARLY EXAM 2010


SM_MANDA

C++ Practical Assignment


VJAGARWAL

C++ Assignment
PREMENDRA YADAW

class 11 sumita arora


VIPUL SACHDEVA

Programs List for Class XI-2013_14


NITA23ARORA2321

cpp_record
API-3870545

C++ Practical File Complete


KEVIN ALLUVALIA

C++
VIKAS SAXENA

Accelerated C++, Practical Programming by Example - Andre...


PAM481475107

Practical
NUPUR BHUTANI
dff
c++ Programs
SUGANDH GUPTA

c++
SAKSHI SINGH

c++
PRADEEP NAIK

C++ programs - solved


PRANSHAVS

C++ Programs Coding Vol.2


VJAGARWAL

c++ Practical
SUNIL TRIVEDI

c Constants
SHIVANSH KUMAR KULPEHRA

c++
AMIT VERMA

C++
MARCELO ANJOS

C++

c++
HARSH BHAGAT

C++ Programs
DNIMISH

C+ Programming__0750657383
API-19755110

Practicals
DHVANI5988

C++ Practices
PRATEEK SINGHAL

C++ Programs Coding Vol.1


VJAGARWAL

More From This User


Chemistry investigatory project
ALOKKUMAR012345

c++ programs for class 12


ALOKKUMAR012345

SQL
ALOKKUMAR012345

Das könnte Ihnen auch gefallen