Answer:
Please kindly go to the explanation part.
Explanation:
The required function is written in Raw code below.
Function:
#include<stdio.h>
#include<ctype.h> //including required libraries
int countstuff(char s[]){ //Function countstuff
int cntUp=0,cntLow =0,cntDigits = 0,i=0,value; //declaring required variables
for(i=0;s[i]!='\0';i++){ //loop to iterate over the characters of string
if(isupper(s[i])){
cntUp++; //incrementing count of uppercase if it is uppercase character
}
else if(islower(s[i])){
cntLow++; //incrementing count of lowercase if it is lowercase character
}
else if(isdigit(s[i])){
cntDigits++; //incrementing count of digits if it is digit
}
}
value = cntUp*1000000 + cntLow*1000 + cntDigits; //counting value using formula given in question
return value; //returning the value
}
void main(){
char string[1000]; //declaring required variables
int value;
printf("Enter a String:");
scanf("%[^\n]s",string); //taking string as input
value = countstuff(string); //calling function
printf("The Value is : %d\n",value); //printing result
}
Answer:
system software is the software which control overall operation of the computer . For eg. Ms.dos ,window 2003 ,etc whereas application software is a software which work on the top of operating system to solve number of problems .For eg. Ms.word,Ms.excel,etc
I’d also say B, which is 2
Answer:
Data manipulation languages are used for the retrieval of the,insertion,deletion and modification of data.
Explanation:
Data Manipulation Languages(DML) are used to insert,delete,update,modify the data in the database.
The commands used to do these operations are as following:-
INSERT INTO :-This command is used to insert values in the database.
DELETE:-It is used to delete existing records from the table.
UPDATE:- It is used to modify the records in the table.
SELECT:- It is used to select data from database.
Big-O notation is a way to describe a function that represents the n amount of times a program/function needs to be executed.
(I'm assuming that := is a typo and you mean just =, by the way)
In your case, you have two loops, nested within each other, and both loop to n (inclusive, meaning, that you loop for when i or j is equal to n), and both loops iterate by 1 each loop.
This means that both loops will therefore execute an n amount of times. Now, if the loops were NOT nested, our big-O would be O(2n), because 2 loops would run an n amount of times.
HOWEVER, since the j-loop is nested within i-loop, the j-loop executes every time the i-loop <span>ITERATES.
</span>
As previously mentioned, for every i-loop, there would be an n amount of executions. So if the i-loop is called an n amount of times by the j loop (which executes n times), the big-O notation would be O(n*n), or O(n^2).
(tl;dr) In basic, it is O(n^2) because the loops are nested, meaning that the i-loop would be called n times, and for each iteration, it would call the j-loop n times, resulting in n*n runs.
A way to verify this is to write and test program the above. I sometimes find it easier to wrap my head around concepts after testing them myself.