The document contains solutions to 50 programming problems in C language. For each problem, the code includes the problem number, code snippet with comments, and input/output. The solutions cover topics like loops, conditional statements, arrays, functions etc. and calculate sums, averages, find even/odd numbers within ranges. Overall the document provides coding solutions and explanations to 50 different programming questions.
The document contains 10 coding questions on C programming concepts like loops, functions, arrays, sorting, and prime numbers. Each question includes sample code to solve a problem, such as summing the digits of a number using a while loop, printing a triangle pattern using nested for loops, or finding prime numbers between two ranges.
The document contains C program code snippets for solving various math and logic problems. These include programs to find roots of a quadratic equation, generate the Fibonacci series, find Armstrong numbers between intervals, check if a number is prime, and convert between binary, decimal and other number bases. It also includes programs to check for palindromes, calculate power of a number using a while loop, and convert decimal numbers to hexadecimal representation.
The document provides instructions for solving a system of linear equations using Gaussian elimination and the Regula Falsi method. It includes sample code to implement (1) Gaussian elimination to solve the system of equations x+2y=10, 2x+y+z=9, 5x+3y+2z=23 and (2) the Regula Falsi method to find a root of the equation x^2 - 8x + 15 = 0.
The document contains source code for multiple C programming assignments. The code includes programs to:
1) Convert a string to uppercase/lowercase, count characters, vowels, consonants, and spaces.
2) Perform binary search on an array.
3) Multiply two matrices.
4) Sort an array in ascending and descending order.
5) Calculate power of a number using recursion.
6) Print tables for multiplication from 1 to 10.
The document contains code snippets demonstrating various programming concepts in C including:
- Hello world program
- Infinite loops using while and for loops
- For and while loops to iterate from 0 to 5
- Increment and decrement operators
- Functions to add two numbers and using pointers
- Conditional operators to check odd/even
- Switch statements
- Checking leap years
- Palindrome, perfect, and factorial numbers using recursion
- Greatest common divisor and least common multiple
- Converting between binary and decimal
- Permutations and combinations using functions
- Pattern matching using loops and variables
The document discusses different parameter passing techniques in C like pass by value, pass by reference, and how to pass arrays to functions. It provides examples of passing single and multi-dimensional arrays to functions using pass by value and pass by reference. It also discusses nesting of functions and using pointers as function arguments.
The document contains 11 questions related to string manipulation and function problems in C programming. For each question, it provides the full source code of a C program that implements the given task. The questions cover topics such as reading and manipulating strings, calculating lengths, reversing strings, copying strings, comparing strings, counting characters, and defining and calling functions to perform operations on integers like addition, multiplication, factorial, prime checking etc.
The document discusses various aspects of loops in C programming, including:
1) It explains the basic structure of a while loop with initialization, condition checking, and incrementation of the loop counter variable.
2) It discusses the scope of variables in loops and the use of increment/decrement operators like ++ and --.
3) It compares the difference between using i++ and ++i as part of a loop, explaining how the order of incrementation vs. printing affects the output.
The document contains 10 coding questions on C programming concepts like loops, functions, arrays, sorting, and prime numbers. Each question includes sample code to solve a problem, such as summing the digits of a number using a while loop, printing a triangle pattern using nested for loops, or finding prime numbers between two ranges.
The document contains C program code snippets for solving various math and logic problems. These include programs to find roots of a quadratic equation, generate the Fibonacci series, find Armstrong numbers between intervals, check if a number is prime, and convert between binary, decimal and other number bases. It also includes programs to check for palindromes, calculate power of a number using a while loop, and convert decimal numbers to hexadecimal representation.
The document provides instructions for solving a system of linear equations using Gaussian elimination and the Regula Falsi method. It includes sample code to implement (1) Gaussian elimination to solve the system of equations x+2y=10, 2x+y+z=9, 5x+3y+2z=23 and (2) the Regula Falsi method to find a root of the equation x^2 - 8x + 15 = 0.
The document contains source code for multiple C programming assignments. The code includes programs to:
1) Convert a string to uppercase/lowercase, count characters, vowels, consonants, and spaces.
2) Perform binary search on an array.
3) Multiply two matrices.
4) Sort an array in ascending and descending order.
5) Calculate power of a number using recursion.
6) Print tables for multiplication from 1 to 10.
The document contains code snippets demonstrating various programming concepts in C including:
- Hello world program
- Infinite loops using while and for loops
- For and while loops to iterate from 0 to 5
- Increment and decrement operators
- Functions to add two numbers and using pointers
- Conditional operators to check odd/even
- Switch statements
- Checking leap years
- Palindrome, perfect, and factorial numbers using recursion
- Greatest common divisor and least common multiple
- Converting between binary and decimal
- Permutations and combinations using functions
- Pattern matching using loops and variables
The document discusses different parameter passing techniques in C like pass by value, pass by reference, and how to pass arrays to functions. It provides examples of passing single and multi-dimensional arrays to functions using pass by value and pass by reference. It also discusses nesting of functions and using pointers as function arguments.
The document contains 11 questions related to string manipulation and function problems in C programming. For each question, it provides the full source code of a C program that implements the given task. The questions cover topics such as reading and manipulating strings, calculating lengths, reversing strings, copying strings, comparing strings, counting characters, and defining and calling functions to perform operations on integers like addition, multiplication, factorial, prime checking etc.
The document discusses various aspects of loops in C programming, including:
1) It explains the basic structure of a while loop with initialization, condition checking, and incrementation of the loop counter variable.
2) It discusses the scope of variables in loops and the use of increment/decrement operators like ++ and --.
3) It compares the difference between using i++ and ++i as part of a loop, explaining how the order of incrementation vs. printing affects the output.
The document contains code to calculate the sum of the digits of the factorial of a given number. It initializes an array to store the digits, calculates the factorial iteratively by multiplying by numbers from 1 to the given number, stores the digits in the array, prints out the factorial and calculates the sum of its digits.
The document contains multiple C++ code examples for programming exercises. It includes code to generate and output matrices, sort vectors, loop through ranges printing values, and calculate averages of two digit numbers. Jefferson Caiza is listed as the student name for the programming course. The code examples demonstrate basic programming concepts like loops, arrays, conditionals, and math operations.
The document contains C code implementations of several numerical methods for solving equations, performing numerical integration, and solving ordinary differential equations. These include the bisection method, Newton-Raphson method, interpolation methods, trapezoidal rule, Simpson's rules, and Euler and Runge-Kutta methods. For each method, the relevant theory is briefly explained, then C code is provided as an example to solve a sample problem using that particular method.
The document contains C code snippets for various programming problems including calculating the area of shapes, finding roots of quadratic equations, sorting arrays, matrix multiplication, and more. The last problem is a program to list the names of students who scored over 60% total marks across three subjects, using a structure variable to store student data.
The document contains code snippets and explanations for various string, number, array, and pattern problems in C programming. It includes functions to count characters and words in a string, reverse a string, change case, sort strings, check if strings are anagrams, reverse numbers, find factors, and more. It also includes examples of binary search on arrays, reversing and merging arrays, and calculating bit differences between numbers.
The document contains 10 programs related to sorting and graph algorithms. Program 1-7 implement different sorting algorithms - insertion sort, selection sort, heap sort, quick sort, counting sort, merge sort and radix sort. Program 8 implements the greedy knapsack problem. Program 9 implements the travelling salesman problem. Program 10 implements Kruskal's algorithm to find the minimum spanning tree of a graph.
The documents contain program code snippets for various sorting and searching algorithms in C programming language including selection sort, bubble sort, quick sort, merge sort, insertion sort, binary search and linear search. The programs take input from the user, implement the respective algorithms to sort or search arrays of numbers, and output the results.
This document contains C code examples for various programming concepts like functions, loops, arrays, structures, unions, file handling etc. There are a total of 30 code snippets showing how to use different data types, control structures and functions in C programming language. The code snippets range from simple Hello World program to more complex examples demonstrating concepts like recursion, structures, file handling etc.
This document contains C code examples for various programming concepts like functions, loops, arrays, structures, pointers etc. There are a total of 40 code snippets showing how to use different features in C like printing output, taking input, if-else conditions, switch case, loops (while, for, do-while), functions (call by value, call by reference), arrays (single, multi-dimensional), structures, pointers etc. Each code snippet is commented and labeled to explain the concept demonstrated in that section.
Ex.1 Write a program to print the following pattern
1
2 2
3 3 3
4 4 4 4
5 5 5 5 5
Ex.2 Write a program to find bigger of three integers.
Ex.3 Write a program to calculate GCD between two numbers.
Ex.4 Write a program to find transpose of matrix.
Ex.5 Write a program which deletes an element from an array & display all other elements.
Ex.6 Write a program to calculate XA+YB where A & B are matrix & X=2, Y=3.
Ex.7 Write a program to calculate the total amount of money in the piggy bank, given that coins of Rs.10, Rs.5, Rs.2, RS.1.
& many more.....
This C++ program prints all prime numbers between 1 and 200. It uses a nested for and while loop to check each number for primality by testing for divisibility against all numbers from 2 to the number itself. After printing 10 prime numbers, it prints a new line. Finally, it prints the total number of prime numbers found.
This document contains source code for 14 programs written in C programming language by Sumant Diwakar as part of a practical file for a Computer Programming Lab course. The programs include conversions between Fahrenheit and Celsius temperatures, checking if a number is a perfect square, sorting numbers in ascending and descending order, checking vowels, calculating factorials, and other numerical calculations and patterns. Each program section contains the source code and output for that program.
1. The document contains 10 code snippets implementing various data structures and algorithms in C/C++ like linear search, binary search, merge sort, quick sort, selection sort, bubble sort, stack implementation using array, Fibonacci series using recursion, queue implementation using array, and binary search tree operations like insertion, deletion, display and traversal.
2. The codes include functions for searching an element, sorting arrays, implementing stacks and queues as well as common operations on binary search trees.
3. Main functions are included to accept user input, call the relevant functions and output the results of operations like searching, sorting or tree traversals.
The document contains 14 code snippets that provide solutions to common programming problems in C including: printing patterns like numbers, stars, triangles using loops; finding sum of digits, checking palindrome, Armstrong number; sorting arrays using bubble, selection sort; string operations like concatenation; matrix addition; factorial; checking even-odd; Floyd's triangle. Each code snippet includes the header files, function definitions and main function to accept input, call functions and print output.
The document contains 14 code snippets that provide solutions to common programming problems in C including: printing patterns like numbers, stars, triangles using loops; finding sum of digits, checking palindrome, Armstrong number; sorting arrays using bubble sort, selection sort; string operations like concatenation; matrix addition; factorial calculation; checking even/odd number. Each code snippet includes the header files, function definitions and main function to accept input, call functions and print output.
The document contains code snippets and questions related to C programming. It includes questions on functions to check birthdays, find syntax errors, count odd divisor numbers, check if a number is prime, swap bits, calculate array sums, find maximum of 3 numbers, rotate linked lists, calculate unlocking keys from locking keys, and insert strings into ternary search trees. Solutions to the questions are also provided as code snippets.
The document contains programs for various sorting and searching algorithms like insertion sort, selection sort, bubble sort, linear search, binary search, etc. It also includes programs for stack operations, queue operations, tower of Hanoi, infix to postfix conversion and postfix evaluation. Each program is written in C language and contains the main logic/code to implement the given algorithm or data structure operation.
The document contains 24 C programming examples demonstrating various programming concepts like input/output, arithmetic operations, conditional statements, loops, functions, strings, arrays and matrices. The examples include programs to calculate sum and average, area of shapes, simple and compound interest, employee salary calculation, swapping values, finding largest number, checking vowels, printing tables, factorials, reversing numbers, string operations and matrix addition.
These problems are so common that you will find in any C learning curriculum. Either in your college or in any IT institute.
I have provided solutions to these problems as well.
Happy learning...
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...PECB
Denis is a dynamic and results-driven Chief Information Officer (CIO) with a distinguished career spanning information systems analysis and technical project management. With a proven track record of spearheading the design and delivery of cutting-edge Information Management solutions, he has consistently elevated business operations, streamlined reporting functions, and maximized process efficiency.
Certified as an ISO/IEC 27001: Information Security Management Systems (ISMS) Lead Implementer, Data Protection Officer, and Cyber Risks Analyst, Denis brings a heightened focus on data security, privacy, and cyber resilience to every endeavor.
His expertise extends across a diverse spectrum of reporting, database, and web development applications, underpinned by an exceptional grasp of data storage and virtualization technologies. His proficiency in application testing, database administration, and data cleansing ensures seamless execution of complex projects.
What sets Denis apart is his comprehensive understanding of Business and Systems Analysis technologies, honed through involvement in all phases of the Software Development Lifecycle (SDLC). From meticulous requirements gathering to precise analysis, innovative design, rigorous development, thorough testing, and successful implementation, he has consistently delivered exceptional results.
Throughout his career, he has taken on multifaceted roles, from leading technical project management teams to owning solutions that drive operational excellence. His conscientious and proactive approach is unwavering, whether he is working independently or collaboratively within a team. His ability to connect with colleagues on a personal level underscores his commitment to fostering a harmonious and productive workplace environment.
Date: May 29, 2024
Tags: Information Security, ISO/IEC 27001, ISO/IEC 42001, Artificial Intelligence, GDPR
-------------------------------------------------------------------------------
Find out more about ISO training and certification services
Training: ISO/IEC 27001 Information Security Management System - EN | PECB
ISO/IEC 42001 Artificial Intelligence Management System - EN | PECB
General Data Protection Regulation (GDPR) - Training Courses - EN | PECB
Webinars: https://pecb.com/webinars
Article: https://pecb.com/article
-------------------------------------------------------------------------------
For more information about PECB:
Website: https://pecb.com/
LinkedIn: https://www.linkedin.com/company/pecb/
Facebook: https://www.facebook.com/PECBInternational/
Slideshare: http://www.slideshare.net/PECBCERTIFICATION
This presentation includes basic of PCOS their pathology and treatment and also Ayurveda correlation of PCOS and Ayurvedic line of treatment mentioned in classics.
More Related Content
Similar to Assignment_URI_Code_Solution_Roll_2010052 (1).pdf
The document contains code to calculate the sum of the digits of the factorial of a given number. It initializes an array to store the digits, calculates the factorial iteratively by multiplying by numbers from 1 to the given number, stores the digits in the array, prints out the factorial and calculates the sum of its digits.
The document contains multiple C++ code examples for programming exercises. It includes code to generate and output matrices, sort vectors, loop through ranges printing values, and calculate averages of two digit numbers. Jefferson Caiza is listed as the student name for the programming course. The code examples demonstrate basic programming concepts like loops, arrays, conditionals, and math operations.
The document contains C code implementations of several numerical methods for solving equations, performing numerical integration, and solving ordinary differential equations. These include the bisection method, Newton-Raphson method, interpolation methods, trapezoidal rule, Simpson's rules, and Euler and Runge-Kutta methods. For each method, the relevant theory is briefly explained, then C code is provided as an example to solve a sample problem using that particular method.
The document contains C code snippets for various programming problems including calculating the area of shapes, finding roots of quadratic equations, sorting arrays, matrix multiplication, and more. The last problem is a program to list the names of students who scored over 60% total marks across three subjects, using a structure variable to store student data.
The document contains code snippets and explanations for various string, number, array, and pattern problems in C programming. It includes functions to count characters and words in a string, reverse a string, change case, sort strings, check if strings are anagrams, reverse numbers, find factors, and more. It also includes examples of binary search on arrays, reversing and merging arrays, and calculating bit differences between numbers.
The document contains 10 programs related to sorting and graph algorithms. Program 1-7 implement different sorting algorithms - insertion sort, selection sort, heap sort, quick sort, counting sort, merge sort and radix sort. Program 8 implements the greedy knapsack problem. Program 9 implements the travelling salesman problem. Program 10 implements Kruskal's algorithm to find the minimum spanning tree of a graph.
The documents contain program code snippets for various sorting and searching algorithms in C programming language including selection sort, bubble sort, quick sort, merge sort, insertion sort, binary search and linear search. The programs take input from the user, implement the respective algorithms to sort or search arrays of numbers, and output the results.
This document contains C code examples for various programming concepts like functions, loops, arrays, structures, unions, file handling etc. There are a total of 30 code snippets showing how to use different data types, control structures and functions in C programming language. The code snippets range from simple Hello World program to more complex examples demonstrating concepts like recursion, structures, file handling etc.
This document contains C code examples for various programming concepts like functions, loops, arrays, structures, pointers etc. There are a total of 40 code snippets showing how to use different features in C like printing output, taking input, if-else conditions, switch case, loops (while, for, do-while), functions (call by value, call by reference), arrays (single, multi-dimensional), structures, pointers etc. Each code snippet is commented and labeled to explain the concept demonstrated in that section.
Ex.1 Write a program to print the following pattern
1
2 2
3 3 3
4 4 4 4
5 5 5 5 5
Ex.2 Write a program to find bigger of three integers.
Ex.3 Write a program to calculate GCD between two numbers.
Ex.4 Write a program to find transpose of matrix.
Ex.5 Write a program which deletes an element from an array & display all other elements.
Ex.6 Write a program to calculate XA+YB where A & B are matrix & X=2, Y=3.
Ex.7 Write a program to calculate the total amount of money in the piggy bank, given that coins of Rs.10, Rs.5, Rs.2, RS.1.
& many more.....
This C++ program prints all prime numbers between 1 and 200. It uses a nested for and while loop to check each number for primality by testing for divisibility against all numbers from 2 to the number itself. After printing 10 prime numbers, it prints a new line. Finally, it prints the total number of prime numbers found.
This document contains source code for 14 programs written in C programming language by Sumant Diwakar as part of a practical file for a Computer Programming Lab course. The programs include conversions between Fahrenheit and Celsius temperatures, checking if a number is a perfect square, sorting numbers in ascending and descending order, checking vowels, calculating factorials, and other numerical calculations and patterns. Each program section contains the source code and output for that program.
1. The document contains 10 code snippets implementing various data structures and algorithms in C/C++ like linear search, binary search, merge sort, quick sort, selection sort, bubble sort, stack implementation using array, Fibonacci series using recursion, queue implementation using array, and binary search tree operations like insertion, deletion, display and traversal.
2. The codes include functions for searching an element, sorting arrays, implementing stacks and queues as well as common operations on binary search trees.
3. Main functions are included to accept user input, call the relevant functions and output the results of operations like searching, sorting or tree traversals.
The document contains 14 code snippets that provide solutions to common programming problems in C including: printing patterns like numbers, stars, triangles using loops; finding sum of digits, checking palindrome, Armstrong number; sorting arrays using bubble, selection sort; string operations like concatenation; matrix addition; factorial; checking even-odd; Floyd's triangle. Each code snippet includes the header files, function definitions and main function to accept input, call functions and print output.
The document contains 14 code snippets that provide solutions to common programming problems in C including: printing patterns like numbers, stars, triangles using loops; finding sum of digits, checking palindrome, Armstrong number; sorting arrays using bubble sort, selection sort; string operations like concatenation; matrix addition; factorial calculation; checking even/odd number. Each code snippet includes the header files, function definitions and main function to accept input, call functions and print output.
The document contains code snippets and questions related to C programming. It includes questions on functions to check birthdays, find syntax errors, count odd divisor numbers, check if a number is prime, swap bits, calculate array sums, find maximum of 3 numbers, rotate linked lists, calculate unlocking keys from locking keys, and insert strings into ternary search trees. Solutions to the questions are also provided as code snippets.
The document contains programs for various sorting and searching algorithms like insertion sort, selection sort, bubble sort, linear search, binary search, etc. It also includes programs for stack operations, queue operations, tower of Hanoi, infix to postfix conversion and postfix evaluation. Each program is written in C language and contains the main logic/code to implement the given algorithm or data structure operation.
The document contains 24 C programming examples demonstrating various programming concepts like input/output, arithmetic operations, conditional statements, loops, functions, strings, arrays and matrices. The examples include programs to calculate sum and average, area of shapes, simple and compound interest, employee salary calculation, swapping values, finding largest number, checking vowels, printing tables, factorials, reversing numbers, string operations and matrix addition.
These problems are so common that you will find in any C learning curriculum. Either in your college or in any IT institute.
I have provided solutions to these problems as well.
Happy learning...
Similar to Assignment_URI_Code_Solution_Roll_2010052 (1).pdf (20)
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...PECB
Denis is a dynamic and results-driven Chief Information Officer (CIO) with a distinguished career spanning information systems analysis and technical project management. With a proven track record of spearheading the design and delivery of cutting-edge Information Management solutions, he has consistently elevated business operations, streamlined reporting functions, and maximized process efficiency.
Certified as an ISO/IEC 27001: Information Security Management Systems (ISMS) Lead Implementer, Data Protection Officer, and Cyber Risks Analyst, Denis brings a heightened focus on data security, privacy, and cyber resilience to every endeavor.
His expertise extends across a diverse spectrum of reporting, database, and web development applications, underpinned by an exceptional grasp of data storage and virtualization technologies. His proficiency in application testing, database administration, and data cleansing ensures seamless execution of complex projects.
What sets Denis apart is his comprehensive understanding of Business and Systems Analysis technologies, honed through involvement in all phases of the Software Development Lifecycle (SDLC). From meticulous requirements gathering to precise analysis, innovative design, rigorous development, thorough testing, and successful implementation, he has consistently delivered exceptional results.
Throughout his career, he has taken on multifaceted roles, from leading technical project management teams to owning solutions that drive operational excellence. His conscientious and proactive approach is unwavering, whether he is working independently or collaboratively within a team. His ability to connect with colleagues on a personal level underscores his commitment to fostering a harmonious and productive workplace environment.
Date: May 29, 2024
Tags: Information Security, ISO/IEC 27001, ISO/IEC 42001, Artificial Intelligence, GDPR
-------------------------------------------------------------------------------
Find out more about ISO training and certification services
Training: ISO/IEC 27001 Information Security Management System - EN | PECB
ISO/IEC 42001 Artificial Intelligence Management System - EN | PECB
General Data Protection Regulation (GDPR) - Training Courses - EN | PECB
Webinars: https://pecb.com/webinars
Article: https://pecb.com/article
-------------------------------------------------------------------------------
For more information about PECB:
Website: https://pecb.com/
LinkedIn: https://www.linkedin.com/company/pecb/
Facebook: https://www.facebook.com/PECBInternational/
Slideshare: http://www.slideshare.net/PECBCERTIFICATION
This presentation includes basic of PCOS their pathology and treatment and also Ayurveda correlation of PCOS and Ayurvedic line of treatment mentioned in classics.
This slide is special for master students (MIBS & MIFB) in UUM. Also useful for readers who are interested in the topic of contemporary Islamic banking.
A review of the growth of the Israel Genealogy Research Association Database Collection for the last 12 months. Our collection is now passed the 3 million mark and still growing. See which archives have contributed the most. See the different types of records we have, and which years have had records added. You can also see what we have for the future.
A Strategic Approach: GenAI in EducationPeter Windle
Artificial Intelligence (AI) technologies such as Generative AI, Image Generators and Large Language Models have had a dramatic impact on teaching, learning and assessment over the past 18 months. The most immediate threat AI posed was to Academic Integrity with Higher Education Institutes (HEIs) focusing their efforts on combating the use of GenAI in assessment. Guidelines were developed for staff and students, policies put in place too. Innovative educators have forged paths in the use of Generative AI for teaching, learning and assessments leading to pockets of transformation springing up across HEIs, often with little or no top-down guidance, support or direction.
This Gasta posits a strategic approach to integrating AI into HEIs to prepare staff, students and the curriculum for an evolving world and workplace. We will highlight the advantages of working with these technologies beyond the realm of teaching, learning and assessment by considering prompt engineering skills, industry impact, curriculum changes, and the need for staff upskilling. In contrast, not engaging strategically with Generative AI poses risks, including falling behind peers, missed opportunities and failing to ensure our graduates remain employable. The rapid evolution of AI technologies necessitates a proactive and strategic approach if we are to remain relevant.
Macroeconomics- Movie Location
This will be used as part of your Personal Professional Portfolio once graded.
Objective:
Prepare a presentation or a paper using research, basic comparative analysis, data organization and application of economic information. You will make an informed assessment of an economic climate outside of the United States to accomplish an entertainment industry objective.
This presentation was provided by Steph Pollock of The American Psychological Association’s Journals Program, and Damita Snow, of The American Society of Civil Engineers (ASCE), for the initial session of NISO's 2024 Training Series "DEIA in the Scholarly Landscape." Session One: 'Setting Expectations: a DEIA Primer,' was held June 6, 2024.
How to Add Chatter in the odoo 17 ERP ModuleCeline George
In Odoo, the chatter is like a chat tool that helps you work together on records. You can leave notes and track things, making it easier to talk with your team and partners. Inside chatter, all communication history, activity, and changes will be displayed.
Thinking of getting a dog? Be aware that breeds like Pit Bulls, Rottweilers, and German Shepherds can be loyal and dangerous. Proper training and socialization are crucial to preventing aggressive behaviors. Ensure safety by understanding their needs and always supervising interactions. Stay safe, and enjoy your furry friends!
1. Rajshahi University of Engineering and Technology
“Heavens Light Is Our Guide”
Department of Electrical & Computer Engineering (ECE)
Assignment
Course No: ECE-1103.
Course Title: Computer Programming.
Assignment Name: Solving 50 programming problems.
Submitted To: Submitted By:
Sagor Chandro Bakchy.
Assistant Professor,
Department of Electrical & Computer
Engineering, RUET
MD. Samiul Haque Biswas.
Roll: 2010052.
Session: 2020-21
2. BeeCrowd ID link: https://www.beecrowd.com.br/judge/en/profile/692469
Problem No: 1051
Solution Code:
#include <stdio.h>
int main()
{
float salary;
scanf("%f", &salary);
if (salary <= 2000)
{
printf("Isenton");
}
else if (salary <= 3000)
{
printf("R$ %.2fn", (salary-2000)*0.08);
}
else if (salary <= 4500)
{
printf("R$ %.2fn", 80+((salary-3000)*0.18));
}
else if(salary>4500)
{
printf("R$ %.2fn", 350+((salary-4500)*0.28));
}
return 0;
}
3. Problem No: 1052
Solution Code:
#include <stdio.h>
int main()
{
int a;
scanf("%d", &a);
switch (a)
{
case 1:
printf("Januaryn");
break;
case 2:
printf("Februaryn");
break;
case 3:
printf("Marchn");
break;
case 4:
printf("Apriln");
break;
case 5:
printf("Mayn");
break;
case 6:
printf("Junen");
break;
case 7:
printf("Julyn");
4. break;
case 8:
printf("Augustn");
break;
case 9:
printf("Septembern");
break;
case 10:
printf("Octobern");
break;
case 11:
printf("Novembern");
break;
case 12:
printf("Decembern");
break;
}
return 0;
}
Problem NO: 1059
Solution Code:
#include <stdio.h>
int main()
{
for (int i = 2; i < 101; i = i + 2)
{
printf("%dn", i);
}
return 0;
5. }
Problem No: 1061
Solution Code:
#include <stdio.h>
int main()
{
int h, hh, hr, m, mm, d, dm, s, ss;
scanf("Dia %d", &d);
scanf("%d : %d : %dn", &h, &m, &s);
scanf("Dia %d", &dm);
scanf("%d : %d : %d", &hh, &mm, &ss);
s = ss - s;
m = mm - m;
h = hh - h;
d = dm - d;
if (s < 0)
{
s += 60;
m--;
}
if (m < 0)
{
m += 60;
h--;
}
if (h < 0)
{
h += 24;
d--;
6. }
printf("%d dia(s)n", d);
printf("%d hora(s)n", h);
printf("%d minuto(s)n", m);
printf("%d segundo(s)n", s);
return 0;
}
Problem No: 1060
Solution Code:
#include <stdio.h>
int main()
{
int t = 6,s=0;
while (t--)
{
float a;
scanf("%f", &a);
if (a > 0)
s++;
}
printf("%d valores positivosn", s);
return 0;
}
Problem No: 1061
Solution Code:
#include <stdio.h>
int main()
{
7. int h, hh, hr, m, mm, d, dm, s, ss;
scanf("Dia %d", &d);
scanf("%d : %d : %dn", &h, &m, &s);
scanf("Dia %d", &dm);
scanf("%d : %d : %d", &hh, &mm, &ss);
s = ss - s;
m = mm - m;
h = hh - h;
d = dm - d;
if (s < 0)
{
s += 60;
m--;
}
if (m < 0)
{
m += 60;
h--;
}
if (h < 0)
{
h += 24;
d--;
}
8. printf("%d dia(s)n", d);
printf("%d hora(s)n", h);
printf("%d minuto(s)n", m);
printf("%d segundo(s)n", s);
return 0;
}
Problem No: 1064
Solution Code:
#include <stdio.h>
int main()
{
int t = 6,s=0; //SamiulHaque
float x=0;
while (t--)
{
float a;
scanf("%f", &a);
if (a > 0)
{
s++;
x = x + a;
}
}
printf("%d valores positivosn", s);
printf("%.1fn", float(x / s));
return 0;
}
9. Problem No: 1065
Solution Code:
#include <stdio.h>
int main()
{
int t = 5, s = 0;
while (t--)
{
int a;
scanf("%d", &a);
if (a % 2 == 0)
s++;
}
printf("%d valores paresn", s);
return 0;
}
Problem No: 1066
Solution Code:
#include <stdio.h>
int main()
{
int t = 5, e = 0, o = 0, p = 0, n = 0;
while (t--)
{
int a;
scanf("%d", &a);
if (a % 2 == 0 || (a*(-1))%2==0) //SamiulHaque
{
10. e++;
}
else
{
o++;
}
if (a > 0)
{
p++;
}
else if(a<0)
{
n++;
}
}
printf("%d valor(es) par(es)n", e);
printf("%d valor(es) impar(es)n", o);
printf("%d valor(es) positivo(s)n", p);
printf("%d valor(es) negativo(s)n", n);
return 0;
}
Problem No: 1067
Solution Code:
#include<stdio.h>
int main()
{
int t;
11. scanf("%d", &t);
for (int i = 1; i < t + 1; i=i+2)
{
printf("%dn", i);
}
return 0;
}
Problem No: 1070
Solution Code:
#include <stdio.h>
int main()
{
int x;
scanf("%d", &x);
if (x % 2 == 0)
{
for (int i = x+1; i < x + 12; i = i + 2)
{
printf("%dn", i);
}
}
else if (x % 2 != 0)
{
for (int i = x; i < x + 11; i = i + 2)
{
printf("%dn", i);
}
}
return 0;}
12. Problem No: 1071
Solution Code:
#include <stdio.h>
int main()
{
int x, y, s = 0;
scanf("%d %d", &x, &y);
if (x > y)
{
for (int i = y+1; i < x; i++)
{
if (i % 2 != 0)
s = s + i;
}
printf("%dn", s);
}
else if (x < y)
{
for (int i = x+1; i < y; i = i++)
{
if (i % 2 != 0)
s = s + i;
}
printf("%dn", s);
}
else
{
printf("0n");
}
13. }
Problem No: 1072
Solution Code:
#include <stdio.h>
int main()
{
int n,c=0,d=0;
scanf("%d",&n);
for (int i = 0; i < n; i++)
{
int x;
scanf("%d", &x);
if (x >= 10 && x <= 20)
{
c++;
}
else
{
d++; } }
printf("%d inn", c);
printf("%d outn", d);
return 0;
}
Problem No: 1073
Solution Code:
#include <stdio.h>
int main()
14. {
long long int n;
scanf("%lld", &n);
if (n % 2 == 0)
{
for (long long int i = 2; i < n + 1; i=i+2)
{
printf("%lld^2 = %lldn",i,i*i);
}
}
else
{
for(long long int i=2; i<n; i=i+2)
{
printf("%lld^2 = %lldn",i,i*i);
}
}
}
Problem No: 1074
Solution Code:
#include <stdio.h>
int main()
{
int n;
scanf("%d", &n);
while (n--)
{
int x;
15. scanf("%d", &x);
if (x == 0)
{
printf("NULLn");
}
else if (x % 2 == 0 && x > 0)
{
printf("EVEN POSITIVEn");
}
else if (x % 2 == 0 && x < 0)
{
printf("EVEN NEGATIVEn");
}
else if (x % 2 != 0 && x < 0)
{
printf("ODD NEGATIVEn");
}
else if (x % 2 != 0 && x > 0)
{
printf("ODD POSITIVEn");
}
}
return 0;
}
Problem No: 1075
Solution Code:
#include <stdio.h>
int main()
{
16. int n;
scanf("%d", &n);
for (int i = 1; i <= 10000; i++)
{
if (i % n == 2)
printf("%dn",i);
}
return 0;
}
Problem No: 1078
Solution Code:
#include <stdio.h>
int main()
{
int n;
scanf("%d", &n);
for (int i = 1; i <= 10; i++)
{
printf("%d x %d = %dn", i, n, i * n);
}
return 0;
}
Problem No: 1079
Solution Code:
#include <stdio.h>
int main()
{
int n;
17. scanf("%d", &n);
while (n--)
{
float a, b, c;
scanf("%f %f %f", &a, &b, &c);
printf("%.1fn",(a*2+b*3+c*5)/10);
}
return 0;}
Problem No: 1080
Solution Code:
#include <stdio.h>
int main()
{
int highest = -999;
int a[100];
for (int i = 0; i < 100; i++)
{
scanf("%d", &a[i]);
}
for (int i = 0; i < 100; i++)
{
if (highest < a[i])
highest = a[i];
}
printf("%dn", highest);
for (int i = 0; i < 100; i++)
{
if (a[i] == highest)
printf("%dn", i + 1);
18. }
}
Problem No: 1094
Solution Code:
#include <stdio.h>
int main()
{
int n, p = 0, q = 0, r = 0, t;
float e, f, g;
scanf("%d", &n);
while (n--)
{
int x;
char a;
scanf("%d %c", &x, &a);
if (a == 'C')
{
p = p + x;
}
else if (a == 'R')
{
q = q + x;
}
else if (a == 'S')
{
r = r + x;
}
}
t = p + q + r;
19. e = float((p * 100.00) / t);
f = float((q * 100.00) / t);
g = float((r * 100.00) / t);
printf("Total: %d cobaiasn", t);
printf("Total de coelhos: %dn", p);
printf("Total de ratos: %dn", q);
printf("Total de sapos: %dn", r);
printf("Percentual de coelhos: %.2f %%n", e);
printf("Percentual de ratos: %.2f %%n", f);
printf("Percentual de sapos: %.2f %%n", g);
return 0;
}
Problem No: 1095
Solution Code:
#include <stdio.h>
int main()
{
int sum = 60;
for (int i = 1; i <= 37; i = i+3)
{
printf("I=%d J=%dn", i, sum);
sum = sum - 5;
}
return 0;
}
Problem No: 1096
Solution Code:
20. #include <stdio.h>
int main()
{
for (int i = 1; i <= 9; i = i + 2)
{
printf("I=%d J=7n", i);
printf("I=%d J=6n", i);
printf("I=%d J=5n", i);
}
return 0;
}
Problem No: 1097
Solution Code:
#include <stdio.h>
int main()
{
int a = 7, b = 6, c = 5;
for (int i = 1; i <= 9; i = i + 2)
{
printf("I=%d J=%dn", i, a);
printf("I=%d J=%dn", i, b);
printf("I=%d J=%dn", i, c);
a = a + 2;
b = b + 2;
c = c + 2;
}
return 0;
}
21. Problem No: 1098
Solution Code:
#include <stdio.h>
int main()
{
float i, j, a = 1.2, b = 2.2, c = 3.2;
printf("I=0 J=1n");
printf("I=0 J=2n");
printf("I=0 J=3n");
for (i = 0.2; i < 1; i = i + 0.2)
{
printf("I=%0.1f J=%0.1fn", i, a);//SamiulHaque
printf("I=%0.1f J=%0.1fn", i, b);
printf("I=%0.1f J=%0.1fn", i, c);
a = a + 0.2;
b = b + 0.2;
c = c + 0.2;
}
printf("I=1 J=2n");
printf("I=1 J=3n");
printf("I=1 J=4n");
a=2.2,b=3.2,c=4.2;
for (i = 1.2; i < 2; i = i + 0.2)
{
printf("I=%0.1f J=%0.1fn", i, a);//SamiulHaque
printf("I=%0.1f J=%0.1fn", i, b);
printf("I=%0.1f J=%0.1fn", i, c);
22. a = a + 0.2;
b = b + 0.2;
c = c + 0.2;
}
printf("I=2 J=3n");
printf("I=2 J=4n");
printf("I=2 J=5n");
return 0;
}
Problem No: 1099
Solution Code:
#include <stdio.h>
int main()
{
int n;
scanf("%d", &n);
while (n--)
{
int x, y, sum = 0;
scanf("%d %d", &x, &y);
if (x == y)
{
printf("0n");
}
if (x > y && y % 2 == 0)
{
for (int i = y + 1; i < x; i = i + 2)
{
23. sum = sum + i;
}
printf("%dn", sum);
}
else if (x > y && y % 2 != 0)
{
for (int i = y + 2; i < x; i = i + 2)
{
sum = sum + i;
}
printf("%dn", sum);
}
else if (y > x && x % 2 == 0)
{
for (int i = x + 1; i < y; i = i + 2)
{
sum = sum + i;
}
printf("%dn", sum);
}
else if(y>x && x%2!=0)
{
for (int i = x + 2; i < y; i = i + 2)
{
sum = sum + i;
}
printf("%dn", sum);
}
}
24. return 0;
}
Problem No: 1101
Solution Code:
#include <stdio.h>
int main()
{
int m, n;
for (int i = 0; i >= 0; i++)
{
int sum=0;
scanf("%d %d", &m, &n);
if (m > 0 && n > 0)
{
if (m >= n)
{
for (int j = n; j < m + 1; j++)
{
printf("%d ", j);
sum = sum + j;
}
printf("Sum=%dn", sum);
}
else
{
for (int j = m; j < n + 1; j++)
{
printf("%d ", j);
sum = sum + j;
25. }
printf("Sum=%dn", sum);
}
}
else
{
break;
}
}
return 0;
}
Problem No: 1113
Solution Code:
#include <stdio.h>
int main()
{
for (int i = 0; i >= 0; i++)
{
int x, y, r;
scanf("%d %d", &x, &y);
r = x - y;
if (r == 0)
{
break;
}
else if (r > 0)
{
printf("Decrescenten");
}
26. else if (r < 0)
{
printf("Crescenten");
}
}
return 0;
}
Problem No: 1114
Solution Code:
#include <stdio.h>
int main()
{
for (int i = 0; i >= 0; i++)
{
int n;
scanf("%d", &n);
if (n == 2002)
{
printf("Acesso Permitidon");
break;
}
else
{
printf("Senha Invalidan");
}
}
return 0;
}
Problem No: 1115
27. Solution Code:
#include <stdio.h>
int main()
{
for (int i = 0; i >= 0; i++)
{
int x, y;
scanf("%d %d", &x, &y);
if (x == 0 || y == 0)
{
break;
}
else if (x > 0 && y > 0)
{
printf("primeiron");
}
else if (x > 0 && y < 0)
{
printf("quarton");
}
else if (x < 0 && y < 0)
{
printf("terceiron");
}
else if (x < 0 && y > 0)
{
printf("segundon");
}
}
28. return 0;
}
Problem No: 1116
Solution Code:
#include <stdio.h>
int main()
{
int n;
scanf("%d", &n);
while (n--)
{
float x, y;
scanf("%f %f", &x, &y);
if (y == 0)
{
printf("divisao impossiveln");
}
else
{
printf("%.1fn", (x / y));
}
}
return 0;
}
Problem No: 1117
Solution Code:
#include <stdio.h>
int main()
29. {
float x, sum;
int j = 1;
while (j < 3)
{
scanf("%f", &x);
if (x >= 0.0 && x <= 10.0)
{
sum = sum + x;
j++;
continue;
}
else
{
printf("nota invalidan");
continue;
}
}
printf("media = %.2fn", sum / 2.0);
return 0;
}
Problem No: 1118
Solution Code:
#include <stdio.h>
int main()
{
int x = 1, j = 0;
30. float s[2], a, avg;
while (x != 2)
{
if (x == 1)
{
while (j <= 1)
{
scanf("%f", &a);
if (a >= 0.0 && a <= 10.0)
{
s[j] = a;//SamiulHaque
j++;
}
else
{
printf("nota invalidan");
}
}
avg = (s[0] + s[1]) / 2.0;
printf("media = %.2fn", avg);
}
printf("novo calculo (1-sim 2-nao)n");
scanf("%d", &x);
j = 0;
continue;
}
return 0;
31. }
Problem No: 1132
Solution Code:
#include <stdio.h>
int main()
{
int x, y, add = 0;
scanf("%d %d", &x, &y);
if (x == y)
{
printf("0");
}
else if (x > y)
{
for (int i = y; i <=x; i++)
{
if (i % 13 != 0)
{
add = add + i;
}
}
printf("%dn", add);
}
else if (x < y)
{
for (int i = x; i <=y; i++)
{
if (i % 13 != 0)
{
32. add = add + i;
}
}
printf("%dn", add);
}
return 0;
}
Problem No: 1133
Solution Code:
#include <stdio.h>
int main()
{
int x, y, a = 0, b = 0;
scanf("%d %d", &x, &y);
if (x > y)
{
for (int i = y + 1; i < x; i++)
{
if (i % 5 == 2 || i % 5 == 3)
{
printf("%dn", i);
}
}
}
else if (x < y)
{
for (int i = x + 1; i < y; i++)
{
if (i % 5 == 2 || i % 5 == 3)
33. {
printf("%dn", i);
}
}
}
return 0;}
Problem No: 1134
Solution Code:
#include <stdio.h>
int main()
{
int a = 0, b = 0, c = 0;
for (int i = 1; i > 0; i++)
{
int n;
scanf("%d", &n);
if(n==1)
{
a++;
}
else if(n==2)
{
b++;
}
else if(n==3)
{
c++;
}
else if(n==4)
34. {
break;
}
else
{
continue;
}
}
printf("MUITO OBRIGADOn");
printf("Alcool: %dn", a);
printf("Gasolina: %dn", b);
printf("Diesel: %dn", c);
return 0;
}
Problem No: 1142
Solution Code:
#include <stdio.h>
int main()
{
int n;
scanf("%d", &n);
int a = 1, b = 2, c = 3;
while (n--)
{
printf("%d ", a);
printf("%d ", b);
printf("%d ", c);
printf("PUMn");
a = a + 4;
35. b = b + 4;
c = c + 4;
}
return 0;
}
Problem No: 1143
Solution Code:
#include <stdio.h>
int main()
{
int n;
scanf("%d", &n);
for (int i = 1; i <= n; i++)
{
printf("%d %d %dn", i, i * i, i * i * i);
}
return 0;
}
Problem No:1144
Solution Code:
#include <stdio.h>
int main()
{
int n;
scanf("%d", &n);
for (int i = 1; i <= n; i++)
{
36. printf("%d %d %dn", i, i * i, i * i * i);
printf("%d %d %dn", i, (i * i) + 1, (i * i * i) + 1);
}
return 0;
}
Problem No: 1145
Solution Code:
#include <stdio.h>
int main()
{
int x, y, c = 0;
scanf("%d %d", &x, &y);
for (int i = 1; i <= y; i++)
{
if (i % x != 0)
{
printf("%d ", i);//SamiulHaque
}
else if (i % x == 0)
{
printf("%dn",i);
}
}
return 0;
}
Problem No: 1146
Solution Code:
37. #include <stdio.h>
int main()
{
int x;
while (x != 0)
{
scanf("%d", &x);
for (int i = 1; i <= x; i++)
{
if (i % x != 0)
{
printf("%d ", i);//SamiulHaque
}
else if (i % x == 0)
{
printf("%dn", i);
}
}
}
return 0;
}
Problem No:1149
Solution Code:
#include <stdio.h>
int main()
{
int n, a, sum = 0;
38. scanf("%d ", &a);
for (int i = 0; i >= 0; i++)
{
scanf("%d", &n);
if (n > 0)
{
for (int i = a; i < a + n; i++)
{
sum = sum + i;
}
printf("%dn", sum);
break;
}
else
{
continue;
}
}
return 0;
}
Problem No: 1150
Solution Code:
#include <stdio.h>
int main()
{
int x, z, sum = 0, c=0;
39. scanf("%d", &x);
for (int i = 0; i >= 0; i++)
{
scanf("%d", &z);
if (z <= x)
{
continue;
}
else
{
break;
}
}
for (int i = 0; i >= 0; i++)
{
sum = x + i + sum;
c++;
if (sum >= z)
{
break;
}
}
printf("%dn", c);
return 0;
}
Problem No: 1151
Solution Code:
40. #include <stdio.h>
int main()
{
int n, a = 0, b = 1, c;
scanf("%d", &n);
if (n == 1)
{
printf("%n", a);
}
else if (n == 2)
{
printf("%d %dn", a, b);
}
else
{
printf("%d %d", a, b);
for (int i = 2; i < n; ++i)
{
c = a + b;
printf(" %d", c);
a = b;
b = c;
}
printf("n");
}
return 0;
}
41. Problem No: 1153
Solution Code:
#include <stdio.h>
int main()
{
int n, fact = 1;
scanf("%d", &n);
if (n <= 1)
{
printf("1n");
}
else
{
for (int i = 1; i <= n; i++)
{
fact = fact * i;
}
printf("%dn", fact);
}
return 0;
}
Problem No: 1154
Solution Code:
#include <stdio.h>
int main()
{
float sum = 0, a = 0;
42. for (int i = 0; i >= 0; i++)
{
int x;
scanf("%d", &x);
if (x < 0)
{
break;
}
else if (x >= 0)
{
sum = sum + x;
a++;
}
}
printf("%.2fn", float(sum / a));
return 0;
}
Problem No: 1155
Solution Code:
#include <stdio.h>
int main()
{
float sum = 0;
for (float i = 1; i <= 100; i++)
{
sum = sum + (1 / i);
}
43. printf("%.2fn", sum);
return 0;
}
Problem No: 1156
Solution Code:
#include <stdio.h>
#include <math.h>
int main()
{
float sum = 0;
for (float i = 1, j = 0; i <= 39, j <= 20; i = i + 2, j++)
{
sum = sum + (i / pow(2, j));
}
printf("%.2fn", sum);
return 0;
}
Problem No: 1157
Solution Code:
#include <stdio.h>
int main()
{
int n;
scanf("%d", &n);
for (int i = 1; i <= n; i++)
{
if (n % i == 0)
44. {
printf("%dn", i);
}
}
return 0;
}
Problem No: 1158
Solution Code:
#include <stdio.h>
int main()
{
int n;
scanf("%d",&n);
while (n--)
{
int x, y, sum = 0;
scanf("%d %d", &x, &y);
if (x % 2 == 0)
{
for (int i = x; i < x + 2 * y; i++)
{
if (i % 2 != 0)
{
sum = sum + i;
}
}
printf("%dn", sum);
45. }
else if (x % 2 != 0)
{
for (int i = x; i < x + 2 * y; i++)
{
if (i % 2 != 0)
{
sum = sum + i;
}
}
printf("%dn", sum);
}
}
return 0;
}
Problem No: 1159
Solution Code:
#include <stdio.h>
int main()
{
for (int i = 0; i >= 0; i++)
{
int x, sum = 0;
scanf("%d", &x);
if (x == 0)
{
break;
46. }
else
{
for (int i = x; i < x + 10; i++)
{
if (i % 2 == 0)
{
sum = sum + i;
}
else
{
continue;
}
}
printf("%dn", sum);
}
}
return 0;
}
Problem No: 1160
Solution Code:
#include <stdio.h>
int main()
{
int t, pa, pb, c;
double ga, gb, p, q;
scanf("%d", &t);
47. while (t--)
{
c = 0;
scanf("%d %d %lf %lf", &pa, &pb, &ga, &gb);
p = ga / 100;
q = gb / 100;
while (pa <= pb)
{
pa = pa + (pa * p);//SamiulHaque
pb = pb + (pb * q);
c++;
if (c > 100)
{
printf("Mais de 1 seculo.n");
break;
}
}
if (c <= 100)
{
printf("%d anos.n", c);
}
}
return 0;}