Answer:
#include <stdio.h>
#include <string.h>
int main(){
char number[100];
printf("Number: ");
scanf("%s", number);
int sum = 0;
for(int i =0;i<strlen(number);i++){
sum+= number[i] - '0';
}
printf("Sum: %d",sum);
return 0;
}
Explanation:
This declares a c string of 100 characters
char number[100];
This prompts user for input
printf("Number: ");
This gets user input
scanf("%s", number);
This initializes sum to 0
int sum = 0;
This iterates through the input string
for(int i =0;i<strlen(number);i++){
This adds individual digits
sum+= number[i] - '0';
}
This prints the calculated sum
printf("Sum: %d",sum);
return 0;
<span>Answer: Metasearch engines</span>
Answer:
public class ANot {
public static void main(String[] args) {
int numberOfSides = 20;
boolean isQuadrilateral;
if(numberOfSides==4){
isQuadrilateral = true;
System.out.println("The triangle is quadrilateral");
}
else{
isQuadrilateral=false;
System.out.println("The triangle is not quadrilateral");
}
}
}
Explanation:
- Create and Initilize the int variable numberOfSides (You can also receive this from a user using the scanner class for example).
- create a boolean variable isQuadrilateral
- Use if and else statement to check if numberOfSides ==4 and assign true to isQuadrilateral else assign false
Answer:
I need to send black-and-white images in a print-ready format. Therefore, here are the steps I’d follow:
First, I’d shoot my images.
I’d use Photoshop to modify or correct the color of the images.
I’d convert the images into black-and-white versions.
I’d save the selected files in the TIFF format. This method will ensure that the images retain their quality and are print-ready.
I’d also convert these files into the JPEG format to get good-quality, low-resolution images for the client’s web publishing.
The Art Director requires images that they can modify, if required. Therefore, I’ll include files in the TIFF and PSD formats. These are open files and anyone can modify them.
I’d send all these saved copies to the magazine for their work.
Explanation:
just did it and it gave me this answer:)