Explanation:
Given, the cost price of the TV is Rs 24600. Now, the cooler costs Rs 800 more than one-third of the TV. The cost price of the cooler is Rs 9000.
Answer:
See explaination
Explanation:
#include <stdio.h>
#include <stdlib.h>
int main()
{
FILE * file_object;
char file_name[100];
char ch;
int characters=0, words=0;
printf("Enter source file name: ");
scanf("%s", file_name); //asking user to enter the file name
file_object = fopen(file_name, "r"); //open file in read mode
if (file_object == NULL)
{
printf("\nUnable to open file.file not exist\n"); //check if the file is present or not
}
while ((ch = fgetc(file_object)) != EOF) //read each character till the end of the file
{
if (ch == ' ' || ch == '\t' || ch == '\n' || ch == '\0') //if character is space or tab or new line or null character increment word count
words++;
else
characters++; //else increment character count this assures that there is no spaces count
}
printf("The file story.txt has the following Statistics:\n"); //finally print the final statistics
if (characters > 0)
{
printf("Words: %d\n", words+1); //for last word purpose just increment the count of words
printf("Characters (no spaces): %d\n", characters);
}
fclose(file_object); //close the file object
return 0;
}
Answer:
def wordsOfFreqency(words, freq):
text1 = "Apple apPLE mangO aPple orange Orange apple guava Mango mango"
words = []
words1 = []
words1 = text1.split()
words = [x.upper() for x in words1]
freq=[words.count(w) for w in words]
print(dict(zip(freq,words)))
return words
def main():
wordsOfFreqency(words, freq)
if __name__=="__main__":
main() # call main function
Explanation:
This will print the list of strings as per its word frequency.
Output is :
{4: 'APPLE', 3: 'MANGO', 2: 'ORANGE', 1: 'GUAVA'}
Answer
<u>Defination</u><u>-</u><u>:</u>
A control statement is a statement and a statement whose execution its control.
<u>Types-:</u>
- Selection Statement
- Iteration Statement
- Unconditional branching Statement