Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

Write a prog to accept a given string in any order and flash
error if any of the character is different.

For example : If abc is the input then abc, bca, cba, cab
bac are acceptable, but aac or bcd are unacceptable.

Answer Posted / santhoo035

#include<iostream.h>
#include<string.h>
int main()
{
int flag=0,i=0,j=0;
char ar[4]="abc" ;
char temp[4];
cout<<"Plz enter a string with size #3";
cin>>temp;
for(j=0;ar[j];j++)
{
flag=0;
for(i=0;temp[i];i++)
{
if(ar[j]==temp[i])
flag+=1;
}
if(flag==0||flag>1)
break;
}
if(flag==0||flag>1)
cout<<"Not accepted";
else
cout<<"Accepted";
}
Note:PLz convert "iostream.h" into "stdio.h" and "cout<<"
to "printf"

Is This Answer Correct ?    6 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

#include int main(void) { int a=4, b=2; a=b<>2 ; printf("%d",a); return 0; }

1655


could you please send the program code for multiplying sparse matrix in c????

3598


write a c program to input initial & final time in the format hh:mm and find the time intervel between them? Ex inputs are initial 06:30 final 00:05 and 23:22 final 22.30

2718


Write a program to model an exploding firecracker in the xy plane using a particle system

4164


how to programme using switch statements and fuctions, a programme that will output two even numbers, two odd numbers and two prime numbers of the users chioce.

2698


What is the difference between proc means and proc tabulate ? explain with a simple example when you have to use means or tabulate?

4554


How can you relate the function with the structure? Explain with an appropriate example.

3472


create a C-code that will display the total fare of a passenger of a taxi if the driver press enter,the timer will stop. Every 10 counts is 2 pesos. Initial value is 25.00

7010


Cluster head selection in Wireless Sensor Network using C programming language.

3771


write a program for area of circumference of shapes

2588


Can you send Code for Run Length Encoding Of BMP Image in C Language in linux(i.e Compression and Decompression) ?

4418


Design an implement of the inputs functions for event mode

3543


why do you use macros? Explain a situation where you had to incorporate macros in your proc report? use a simple instream data example with code ?

2786


To Write a C program to remove the repeated characters in the entered expression or in entered characters(i.e) removing duplicates. String contains only lowercase characters ['a'-'z']

1011


How to palindrom string in c language?

11161