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


Enter the code:


Enter a value of a that is equal to b.

int main(int argc, char *argv[]) {
	
	int a, b;
	
	// Obtain values for a and b
	printf("Enter the value for integer a: ");
	scanf("%d", &a);
	printf("Enter the value for integer b: ");
	scanf("%d", &b);
	printf("\n\n");
	
	// Compare a and b
	if (a > b)		      // Testing for a greater than b
	{
		printf("a (%d) is bigger than b 0(%d)\n", a, b);
	}
	else if (a == b)      // Testing for equality
	{
		printf("a (%d) is equal to b (%d)\n", a, b);		
	}
	else				  // Otherwise a must be less than b
	{
		printf("a (%d) is less than b (%d)\n", a, b);		
	}
	
	system("pause");
	return 0;
}





loop



#include <stdio.h>


int main()
{
    int n=100;
    
    for(int i=100;i>=0;i--){
        printf("%d\n",i);
    }


    return 0;
}


  • Write a short reflective account of the code concentrating on its functionality and comparing the outputs against the source code.



Enter the Code:

int main(int argc, char *argv[]) {
	
	int a, b;
	
	// Obtain values for a and b
	printf("Enter the value for integer a: ");
	scanf("%d", &a);
	printf("Enter the value for integer b: ");
	scanf("%d", &b);
	printf("\n\n");
	
	// Compare a and b
	if (a > b)		      // Testing for a greater than b
	{
		printf("a (%d) is bigger than b 0(%d)\n", a, b);
	}
	else if (a == b)      // Testing for equality
	{
		printf("a (%d) is equal to b (%d)\n", a, b);		
	}
	else				  // Otherwise a must be less than b
	{
		printf("a (%d) is less than b (%d)\n", a, b);		
	}
	
	system("pause");
	return 0;
}


 Write a short reflective account of the code concentrating on its functionality and comparing the outputs against the source code.


Create a program that will display magic square of numbers based on a given odd magic square size. A magic square is a square array of numbers consisting of the distinct positive integers 1,2, …, arranged such that the sum of the numbers in any horizontal, vertical, or main diagonal line is always the same number, known as the magic constant. The program should ask the user to enter an odd integer that will serve as the size of the square. The program should validate if the entered number is an odd or even number. If the number is even, the program should display an error message and ask the user to enter a number again. Once a valid size is entered, the program should automatically display the magic square.



Create a program that will display magic square of numbers based on a given odd magic square size. A magic square is a square array of numbers consisting of the distinct positive integers 1,2, …, arranged such that the sum of the numbers in any horizontal, vertical, or main diagonal line is always the same number, known as the magic constant. The program should ask the user to enter an odd integer that will serve as the size of the square. The program should validate if the entered number is an odd or even number. If the number is even, the program should display an error message and ask the user to enter a number again. Once a valid size is entered, the program should automatically display the magic square.





Create a C program that stores 10 integers. Print the maximum and the minimum integer found in the array.



Create a program that stores 10 integers. Print the maximum and the minimum integer found in the array.

 Given a number n = abc and with the hash function f(n) = (a*30+ b*31+c*32) mod 9. Then generate the hash table by following linear and quadratic probing resolution separately for the following data set: 476,192,215,729,318,620,586,828,434.

A sorting technique was applied to the following data set 44, 11, 66,33,55,99 After two passes the rearrangement of the data set is as follows 11, 33, 66, 44, 55, 99. Identify the sorting method used and find the arrangement of the data set after the arrangement of the data set after the third pass.

time calculator write a program that asks the user to enter a number of seconds in c language



LATEST TUTORIALS
APPROVED BY CLIENTS