C Answers

Questions answered by Experts: 1 680

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Search

declare two variables x and y.assign values to these variables.Number x should be printed only if it is less than 2000 or greater than 3000 and number y should be printed only if it is between 100 and 500. please explain the logic sir.
write a program which takes name,basic,daper,bonper and loandet for a employee. calculate the salary using the following relation.
salary=basic+basic*daper/100+bonper*basic/100-loandet.

data is
name=MARK,basic=2500,daper=55,bonper=33.33,loandet=250.00
calculate salary and then print the result under the following headings
(salary to be printed to the nearest dollars)
name basic salary
A player will choose a number from the table and will replace that number with one of its divisor. For example, 6 can be replaced with 1, 2, or 3 (since these are the divisors of 6). Similarly, 12 can be replaced with 1, 2, 3, 4 or 6.
In the Byteland country a string "S" is said to super ascii string if and only if count of each character in the string is equal to its ascii value.
In the Byteland country ascii code of 'a' is 1, 'b' is 2 ...'z' is 26.
Your task is to find out whether the given string is a super ascii string or not.

Input Format:

First line contains number of test cases T, followed by T lines, each containing a string "S".

Output Format:

For each test case print "Yes" if the String "S" is super ascii, else print "No"

Constraints:

1<=T<=100

1<=|S|<=400, S will contains only lower case alphabets ('a'-'z').

Sample Input and Output

SNo. Input Output
1
2
bba
scca


Yes
No



Explanation:

In case 1, viz. String "bba" -
The count of character 'b' is 2. Ascii value of 'b' is also 2.
The count of character 'a' is 1. Ascii value of 'a' is also 1.
Hence string "bba" is super ascii.
In the Byteland country a string "S" is said to super ascii string if and only if count of each character in the string is equal to its ascii value.
In the Byteland country ascii code of 'a' is 1, 'b' is 2 ...'z' is 26.
Your task is to find out whether the given string is a super ascii string or not.

Input Format:

First line contains number of test cases T, followed by T lines, each containing a string "S".

Output Format:

For each test case print "Yes" if the String "S" is super ascii, else print "No"

Constraints:
1<=T<=100

1<=|S|<=400, S will contains only lower case alphabets ('a'-'z').
In the Byteland country a string "S" is said to super ascii string if and only if count of each character in the string is equal to its ascii value.
In the Byteland country ascii code of 'a' is 1, 'b' is 2 ...'z' is 26.
Your task is to find out whether the given string is a super ascii string or not.

Input Format:

First line contains number of test cases T, followed by T lines, each containing a string "S".

Output Format:

For each test case print "Yes" if the String "S" is super ascii, else print "No"

Constraints:
1<=T<=100

1<=|S|<=400, S will contains only lower case alphabets ('a'-'z').


Sample Input and Output

SNo. Input Output
1
2
bba
scca


Yes
No



Explanation:

In case 1, viz. String "bba" -
The count of character 'b' is 2. Ascii value of 'b' is also 2.
The count of character 'a' is 1. Ascii value of 'a' is also 1.
Hence string "bba" is super ascii.
Find out whether the given string is a super ascii string or not. in C.
In the Byteland country a string "S" is said to super ascii string if and only if count of each character in the string is equal to its ascii value.
In the Byteland country ascii code of 'a' is 1, 'b' is 2 ...'z' is 26.
Your task is to find out whether the given string is a super ascii string or not.
In the Byteland country a string "S" is said to super ascii string if and only if count of each

character in the string is equal to its ascii value.

In the Byteland country ascii code of 'a' is 1, 'b' is 2 ...'z' is 26.

Your task is to find out whether the given string is a super ascii string or not.

Input Format:

First line contains number of test cases T, followed by T lines, each containing a string "S".

Output Format:

For each test case print "Yes" if the String "S" is super ascii, else print "No"

Constraints:

1<=T<=100

1<=|S|<=400, S will contains only lower case alphabets ('a'-'z').

Sample Input and Output

SNo. Input Output

2

1

bba

scca

Explanation:

In case 1, viz. String "bba" -

The count of character 'b' is 2. Ascii value of 'b' is also 2.

The count of character 'a' is 1. Ascii value of 'a' is also 1.

Hence string "bba" is super ascii.
main( )
{
int x = 10, y = 20 ;
if ( x == y ) ;
printf ( "\n%d %d", x, y ) ;
LATEST TUTORIALS
APPROVED BY CLIENTS