SlideShare a Scribd company logo
1 of 8
1. Problem Statement
Write a C Program - using if else statements, to find the largest
number among the given two integer numbers. -
Instructions
· Write comment to make your programs readable.
· Use descriptive variables in your programs (Name of the
variables shou ld show their purposes).
· Ensure your code compiles without any
errors/warning/deprecations
· Avoid too many & unnecessary usage of white spaces
(newline, spaces, tabs, …)
· Try to retain the original code given in the exercise, to avoi d
any issues in compiling & running your programs
· Always test the program thoroughly, before saving/submitting
exercises/project
Hints/Tips
#include<--->
int main()
{
if ( x > y )
{
printf ();
}
else
{
printf ();
}
}
Expected Output
Enter the values for x and y Input: 250 350 Output: Y is large
number - 350
Close
2. Problem Statement
Write a C Program to extract a portion of a string from a
character string.Instructions
-Write comment to make your programs readable. -Use
descriptive variables in your programs (Name of the variables
shou ld show their purposes). - Ensure your code compiles
without any errors/warning/deprecations - Avoid too many
& unnecessary usage of white spaces (newline, spaces,
tabs, …) - Try to retain the original code given in the exercise,
to avoid any issues in compiling & running your programs
- Always test the program thoroughly, before saving/submitting
exercises/projectHints/Tipsinclude< ---------- >void
main(){l=strlen(str1);if(m+n-1<l) {="" for(i="n-1," j="0;i<m+n-
1;i++,j++)" }="" else="" printf="" ("string="" extraction=""
is="" not="" possible");="" ##="" expected="" output=""
enter="" the="" string="" manipal="" university="" in=""
jaipur="" position="" of="" required="" character:="" 9=""
number="" characters="" to="" be="" extracted:=""
extracted="" is:="" <="" div=""> </l)>
3.Problem Statement
a) Write a C program, to find both the largest and smallest
number in a list of integers using an Array. b) Write a C
program, to add two matrices using an Array. c) Write a C
program, to multiply two matrices using an Array.Instructions
· Write comment to make your programs readable.
· Use descriptive variables in your programs (Name of the
variables shou ld show their purposes).
· Ensure your code compiles without any
errors/warning/deprecations
· Avoid too many &amp; unnecessary usage of white spaces
(newline, spaces, tabs, …)
· Try to retain the original code given in the exercise, to avoid
any issues in compiling &amp; running your programs
· Always test the program thoroughly, before saving/submitting
exercises/projectHints/Tipsinclude <math.h>
void main() { variables; printf("n =====Matrix
Addition=====n"); for(i=0;i&lt;2;i++) { for(j=0;j&lt;2;j++) {
//logic } } printf("n =====Matrix Multiplication=====n");
for(i=0;j&lt;2;j++) { for(j=0;j&lt;2;j++) { for(k=0;k&lt;2;k++)
{ //logic } } } }Expected Output
a) Enter the max no of array elements: 4 enter the array
elements 43 34 45 54 The maximum number in given array is:
54 The minimum number in given array is: 34 b) Enter elements
of matrix A:1 2 3 4 Enter elements of matrix B:1 2 3 4 =====
Matrix Addition ===== 2 4 6 8 c) Enter elements of matrix A: 1
2 3 4 Enter elements of matrix B: 1 2 3 4 ===== Matrix
Multiplication ===== 6 8 12 32
</math.h>
Close
4.
Problem Statement
Write a C program to find the factorial of a given integer
number using both recursive and non-recursive functions.
Instructions
· Write comment to make your programs readable.
· Use descriptive variables in your programs (Name of the
variables shou ld show their purposes).
· Ensure your code compiles without any
errors/warning/deprecations
· Avoid too many &amp; unnecessary usage of white spaces
(newline, spaces, tabs, …)
· Try to retain the original code given in the exercise, to avoid
any issues in compiling &amp; running your programs
· Always test the program thoroughly, before saving/submitting
exercises/project
Hints/Tips
#include&lt; ----- &gt;
longint fact(int)
void main()
{
variables;
printf(“n enter an integer no:”);
scanf(“%d”,&amp;n);
// non-recursive
for(i=1;i&lt;=n;i++)
{
//logic for factorial calculation
}
printf(“Factorial of %d = %d using non-recursive logic n”, n,
variables);
// recursive
printf(“Factorial of %d = %d using recursive logic n”, n,
fact(n));
}
longint fact(int n)
{
//logic for factorial calculation
}
Expected Output
Enter the number: 4 Factorial of 4 = 24
5.
Problem Statement
Write a C Program – using pointers To Swap the Values of Two
Variables.
Instructions
· Write comment to make your programs readable.
· Use descriptive variables in your programs (Name of the
variables shou ld show their purposes).
· Ensure your code compiles without any
errors/warning/deprecations
· Avoid too many &amp; unnecessary usage of white spaces
(newline, spaces, tabs, …)
· Try to retain the original code given in the exercise, to avoid
any issues in compiling &amp; running your programs
· Always test the program thoroughly, before saving/submitting
exercises/project
Hints/Tips
# include&lt; ----- &gt;
# include &lt; ------- &gt;
main ( )
{
Variables;
printf ( “ Enter values of x and y: n”);
scanf( “ %d%d”, x,y);
*temp = ;
*x= ;
*y= ;
printf();
}
Expected Output
Enter values of x and y: 10 20 x=20 y=10
6.Problem Statement
Write a C program – using structures for reading the employee
details like employee name, date of joining and salary and also
to compute Total salary outgo for a month.Instructions
-Write comment to make your programs readable. -Use
descriptive variables in your programs (Name of the variables
shou ld show their purposes). - Ensure your code compiles
without any errors/warning/deprecations - Avoid too many
&amp; unnecessary usage of white spaces (newline, spaces,
tabs, …) - Try to retain the original code given in the exercise,
to avoid any issues in compiling &amp; running your programs
- Always test the program thoroughly, before saving/submitting
exercises/projectHints/Tipsstruct
personal{};main(){variables;printf (“enter number of
employees”); scanf (“%d”,&amp;n);for (i=1; i&lt;=n;
i++){}printf(“enter the month for total
salary”);scanf(“%s”,month)for(i=1; i<n; i++)="" {="" }=""
printf="" (“the="" total="" salary="" for="" giving=""
month="%d”," salary);="" ##="" expected="" output=""
input="" values="" chandu="" 25="" january="" 2012=""
5500="" kishore="" 20="" 5500.00="" enter="" the=""
11000.00="" <="" div=""> </n;>
7. Problem Statement
Write a Program which behaves as prescribed in the below
problem statement - Take input/output as specified - Print the
expected output using the expected logic/algorithm/data - Code
is structured correctly and according to the problem statement
Instructions
· Ensure your code compiles without any
errors/warning/deprecations
· Follow best practices while coding
· Avoid too many &amp; unnecessary usage of white spaces
(newline, spaces, tabs, ...), except to make the code readable
· Use appropriate comments at appropriate places in your
exercise, to explain the logic, rational, solutions, so that
evaluator can know them
· Try to retain the original code given in the exercise, to avoid
any issues in compiling &amp; running your programs
· Always test the program thoroughly, before saving/submitting
exercises/project
· For any issues with your exercise, contact your coach
Example
Inputs:
variable1 = input1
variable2 = input2
/*
Solution
Logic according to asked problem statement */
Expected Output = As described in the problem statement
Warnings
· Take care of whitespace/trailing whitespace
· Trim the output and avoid special characters
· Avoid printing unnecessary values other than expected/asked
output
Hints/Tips
int i = 0;
int j = 0 ;
for (int k =0; k &lt; i; k++) {
printf("this is my hint logic %d", i);
}
8.Problem Statement
Write a C Program – to use structure within union, display the
structure and length of union elements.Instructions
· Write comment to make your programs readable.
· Use descriptive variables in your programs (Name of the
variables shou ld show their purposes).
· Ensure your code compiles without any
errors/warning/deprecations
· Avoid too many &amp; unnecessary usage of white spaces
(newline, spaces, tabs, …)
· Try to retain the original code given in the exercise, to avoid
any issues in compiling &amp; running your programs
· Always test the program thoroughly, before saving/submitting
exercises/projectHints/Tipsinclude <stdio.h>
Struct hai { }; union bye { }; int main(int argc,char *argv[]) {
Struct hai myhai; union bye mybye; …. ….. …..
}Expected Output
myhai: 1 2 This is myhai mybye: 100 4197476 This is mybye
</stdio.h>

More Related Content

Similar to 1. Problem StatementWrite a C Program - using if else statements,

UNIT-1 notes(Data Types – Variables – Operations – Expressions and Statements...
UNIT-1 notes(Data Types – Variables – Operations – Expressions and Statements...UNIT-1 notes(Data Types – Variables – Operations – Expressions and Statements...
UNIT-1 notes(Data Types – Variables – Operations – Expressions and Statements...
RSathyaPriyaCSEKIOT
 

Similar to 1. Problem StatementWrite a C Program - using if else statements, (20)

C Programming Lab manual 18CPL17
C Programming Lab manual 18CPL17C Programming Lab manual 18CPL17
C Programming Lab manual 18CPL17
 
UNIT-1 notes(Data Types – Variables – Operations – Expressions and Statements...
UNIT-1 notes(Data Types – Variables – Operations – Expressions and Statements...UNIT-1 notes(Data Types – Variables – Operations – Expressions and Statements...
UNIT-1 notes(Data Types – Variables – Operations – Expressions and Statements...
 
CBCS 2018 Scheme I sem Lab Manual for 18CPL17
CBCS 2018 Scheme I sem Lab Manual for 18CPL17 CBCS 2018 Scheme I sem Lab Manual for 18CPL17
CBCS 2018 Scheme I sem Lab Manual for 18CPL17
 
C programming
C programmingC programming
C programming
 
PCCF UNIT 1.pptx
PCCF UNIT 1.pptxPCCF UNIT 1.pptx
PCCF UNIT 1.pptx
 
Ppt lesson 06
Ppt lesson 06Ppt lesson 06
Ppt lesson 06
 
Ppt lesson 06
Ppt lesson 06Ppt lesson 06
Ppt lesson 06
 
Ppt lesson 06
Ppt lesson 06Ppt lesson 06
Ppt lesson 06
 
c programming session 1.pptx
c programming session 1.pptxc programming session 1.pptx
c programming session 1.pptx
 
Jeremiah Yancy - Objectives for Software design and testing
Jeremiah Yancy - Objectives for Software design and testingJeremiah Yancy - Objectives for Software design and testing
Jeremiah Yancy - Objectives for Software design and testing
 
Presentation 2.ppt
Presentation 2.pptPresentation 2.ppt
Presentation 2.ppt
 
intro to c
intro to cintro to c
intro to c
 
Complete C++ programming Language Course
Complete C++ programming Language CourseComplete C++ programming Language Course
Complete C++ programming Language Course
 
C programming
C programmingC programming
C programming
 
Introduction to programming c and data-structures
Introduction to programming c and data-structures Introduction to programming c and data-structures
Introduction to programming c and data-structures
 
Introduction to c programming
Introduction to c programmingIntroduction to c programming
Introduction to c programming
 
Introduction%20C.pptx
Introduction%20C.pptxIntroduction%20C.pptx
Introduction%20C.pptx
 
Introduction to programming c and data structures
Introduction to programming c and data structuresIntroduction to programming c and data structures
Introduction to programming c and data structures
 
C++ programming language basic to advance level
C++ programming language basic to advance levelC++ programming language basic to advance level
C++ programming language basic to advance level
 
C++ AND CATEGORIES OF SOFTWARE
C++ AND CATEGORIES OF SOFTWAREC++ AND CATEGORIES OF SOFTWARE
C++ AND CATEGORIES OF SOFTWARE
 

More from TatianaMajor22

Please readRobert Geraci, Russia Minorities and Empire,” in .docx
Please readRobert Geraci, Russia Minorities and Empire,” in .docxPlease readRobert Geraci, Russia Minorities and Empire,” in .docx
Please readRobert Geraci, Russia Minorities and Empire,” in .docx
TatianaMajor22
 
Ford VS ChevroletThere are many reasons that make the Chevy.docx
Ford VS ChevroletThere are many reasons that make the Chevy.docxFord VS ChevroletThere are many reasons that make the Chevy.docx
Ford VS ChevroletThere are many reasons that make the Chevy.docx
TatianaMajor22
 
Appendix 12A Statement of Cash Flows—Direct MethodLEARNING .docx
Appendix 12A Statement of Cash Flows—Direct MethodLEARNING .docxAppendix 12A Statement of Cash Flows—Direct MethodLEARNING .docx
Appendix 12A Statement of Cash Flows—Direct MethodLEARNING .docx
TatianaMajor22
 
Effects of StressProvide a 1-page description of a stressful .docx
Effects of StressProvide a 1-page description of a stressful .docxEffects of StressProvide a 1-page description of a stressful .docx
Effects of StressProvide a 1-page description of a stressful .docx
TatianaMajor22
 
Design Factors NotesCIO’s Office 5 People IT Chief’s Offi.docx
Design Factors NotesCIO’s Office 5 People IT Chief’s Offi.docxDesign Factors NotesCIO’s Office 5 People IT Chief’s Offi.docx
Design Factors NotesCIO’s Office 5 People IT Chief’s Offi.docx
TatianaMajor22
 
Question 12.5 pointsSaveThe OSU studies concluded that le.docx
Question 12.5 pointsSaveThe OSU studies concluded that le.docxQuestion 12.5 pointsSaveThe OSU studies concluded that le.docx
Question 12.5 pointsSaveThe OSU studies concluded that le.docx
TatianaMajor22
 
Case Study 1 Questions1.     What is the allocated budget .docx
Case Study 1 Questions1.     What is the allocated budget  .docxCase Study 1 Questions1.     What is the allocated budget  .docx
Case Study 1 Questions1.     What is the allocated budget .docx
TatianaMajor22
 
Behavior in OrganizationsIntercultural Communications Exercise .docx
Behavior in OrganizationsIntercultural Communications Exercise .docxBehavior in OrganizationsIntercultural Communications Exercise .docx
Behavior in OrganizationsIntercultural Communications Exercise .docx
TatianaMajor22
 
Discussion Question Comparison of Theories on Anxiety Disord.docx
Discussion Question Comparison of Theories on Anxiety Disord.docxDiscussion Question Comparison of Theories on Anxiety Disord.docx
Discussion Question Comparison of Theories on Anxiety Disord.docx
TatianaMajor22
 
I have always liked Dustin Hoffmans style of acting, in this mov.docx
I have always liked Dustin Hoffmans style of acting, in this mov.docxI have always liked Dustin Hoffmans style of acting, in this mov.docx
I have always liked Dustin Hoffmans style of acting, in this mov.docx
TatianaMajor22
 
If you are using the Blackboard Mobile Learn IOS App, please clic.docx
If you are using the Blackboard Mobile Learn IOS App, please clic.docxIf you are using the Blackboard Mobile Learn IOS App, please clic.docx
If you are using the Blackboard Mobile Learn IOS App, please clic.docx
TatianaMajor22
 
MATH 107 FINAL EXAMINATIONMULTIPLE CHOICE1. Deter.docx
MATH 107 FINAL EXAMINATIONMULTIPLE CHOICE1. Deter.docxMATH 107 FINAL EXAMINATIONMULTIPLE CHOICE1. Deter.docx
MATH 107 FINAL EXAMINATIONMULTIPLE CHOICE1. Deter.docx
TatianaMajor22
 
If the CIO is to be valued as a strategic actor, how can he bring.docx
If the CIO is to be valued as a strategic actor, how can he bring.docxIf the CIO is to be valued as a strategic actor, how can he bring.docx
If the CIO is to be valued as a strategic actor, how can he bring.docx
TatianaMajor22
 
I am showing below the proof of breakeven, which is fixed costs .docx
I am showing below the proof of breakeven, which is fixed costs .docxI am showing below the proof of breakeven, which is fixed costs .docx
I am showing below the proof of breakeven, which is fixed costs .docx
TatianaMajor22
 
Karimi 1 Big Picture Blog Post ​ First Draft College .docx
Karimi 1 Big Picture Blog Post ​ First Draft College .docxKarimi 1 Big Picture Blog Post ​ First Draft College .docx
Karimi 1 Big Picture Blog Post ​ First Draft College .docx
TatianaMajor22
 
Please try not to use hard words Thank youWeek 3Individual.docx
Please try not to use hard words Thank youWeek 3Individual.docxPlease try not to use hard words Thank youWeek 3Individual.docx
Please try not to use hard words Thank youWeek 3Individual.docx
TatianaMajor22
 

More from TatianaMajor22 (20)

Please readRobert Geraci, Russia Minorities and Empire,” in .docx
Please readRobert Geraci, Russia Minorities and Empire,” in .docxPlease readRobert Geraci, Russia Minorities and Empire,” in .docx
Please readRobert Geraci, Russia Minorities and Empire,” in .docx
 
Ford VS ChevroletThere are many reasons that make the Chevy.docx
Ford VS ChevroletThere are many reasons that make the Chevy.docxFord VS ChevroletThere are many reasons that make the Chevy.docx
Ford VS ChevroletThere are many reasons that make the Chevy.docx
 
Fairness and Discipline     Weve all been disciplined at one.docx
Fairness and Discipline     Weve all been disciplined at one.docxFairness and Discipline     Weve all been disciplined at one.docx
Fairness and Discipline     Weve all been disciplined at one.docx
 
Appendix 12A Statement of Cash Flows—Direct MethodLEARNING .docx
Appendix 12A Statement of Cash Flows—Direct MethodLEARNING .docxAppendix 12A Statement of Cash Flows—Direct MethodLEARNING .docx
Appendix 12A Statement of Cash Flows—Direct MethodLEARNING .docx
 
Effects of StressProvide a 1-page description of a stressful .docx
Effects of StressProvide a 1-page description of a stressful .docxEffects of StressProvide a 1-page description of a stressful .docx
Effects of StressProvide a 1-page description of a stressful .docx
 
Design Factors NotesCIO’s Office 5 People IT Chief’s Offi.docx
Design Factors NotesCIO’s Office 5 People IT Chief’s Offi.docxDesign Factors NotesCIO’s Office 5 People IT Chief’s Offi.docx
Design Factors NotesCIO’s Office 5 People IT Chief’s Offi.docx
 
Question 12.5 pointsSaveThe OSU studies concluded that le.docx
Question 12.5 pointsSaveThe OSU studies concluded that le.docxQuestion 12.5 pointsSaveThe OSU studies concluded that le.docx
Question 12.5 pointsSaveThe OSU studies concluded that le.docx
 
Case Study 1 Questions1.     What is the allocated budget .docx
Case Study 1 Questions1.     What is the allocated budget  .docxCase Study 1 Questions1.     What is the allocated budget  .docx
Case Study 1 Questions1.     What is the allocated budget .docx
 
Behavior in OrganizationsIntercultural Communications Exercise .docx
Behavior in OrganizationsIntercultural Communications Exercise .docxBehavior in OrganizationsIntercultural Communications Exercise .docx
Behavior in OrganizationsIntercultural Communications Exercise .docx
 
Discussion Question Comparison of Theories on Anxiety Disord.docx
Discussion Question Comparison of Theories on Anxiety Disord.docxDiscussion Question Comparison of Theories on Anxiety Disord.docx
Discussion Question Comparison of Theories on Anxiety Disord.docx
 
I have always liked Dustin Hoffmans style of acting, in this mov.docx
I have always liked Dustin Hoffmans style of acting, in this mov.docxI have always liked Dustin Hoffmans style of acting, in this mov.docx
I have always liked Dustin Hoffmans style of acting, in this mov.docx
 
Is obedience to the law sufficient to ensure ethical behavior Wh.docx
Is obedience to the law sufficient to ensure ethical behavior Wh.docxIs obedience to the law sufficient to ensure ethical behavior Wh.docx
Is obedience to the law sufficient to ensure ethical behavior Wh.docx
 
If you are using the Blackboard Mobile Learn IOS App, please clic.docx
If you are using the Blackboard Mobile Learn IOS App, please clic.docxIf you are using the Blackboard Mobile Learn IOS App, please clic.docx
If you are using the Blackboard Mobile Learn IOS App, please clic.docx
 
Is the proliferation of social media and communication devices a .docx
Is the proliferation of social media and communication devices a .docxIs the proliferation of social media and communication devices a .docx
Is the proliferation of social media and communication devices a .docx
 
MATH 107 FINAL EXAMINATIONMULTIPLE CHOICE1. Deter.docx
MATH 107 FINAL EXAMINATIONMULTIPLE CHOICE1. Deter.docxMATH 107 FINAL EXAMINATIONMULTIPLE CHOICE1. Deter.docx
MATH 107 FINAL EXAMINATIONMULTIPLE CHOICE1. Deter.docx
 
If the CIO is to be valued as a strategic actor, how can he bring.docx
If the CIO is to be valued as a strategic actor, how can he bring.docxIf the CIO is to be valued as a strategic actor, how can he bring.docx
If the CIO is to be valued as a strategic actor, how can he bring.docx
 
I am showing below the proof of breakeven, which is fixed costs .docx
I am showing below the proof of breakeven, which is fixed costs .docxI am showing below the proof of breakeven, which is fixed costs .docx
I am showing below the proof of breakeven, which is fixed costs .docx
 
Examine the way in which death and dying are viewed at different .docx
Examine the way in which death and dying are viewed at different .docxExamine the way in which death and dying are viewed at different .docx
Examine the way in which death and dying are viewed at different .docx
 
Karimi 1 Big Picture Blog Post ​ First Draft College .docx
Karimi 1 Big Picture Blog Post ​ First Draft College .docxKarimi 1 Big Picture Blog Post ​ First Draft College .docx
Karimi 1 Big Picture Blog Post ​ First Draft College .docx
 
Please try not to use hard words Thank youWeek 3Individual.docx
Please try not to use hard words Thank youWeek 3Individual.docxPlease try not to use hard words Thank youWeek 3Individual.docx
Please try not to use hard words Thank youWeek 3Individual.docx
 

Recently uploaded

1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
QucHHunhnh
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
ZurliaSoop
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
kauryashika82
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
ciinovamais
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
negromaestrong
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
heathfieldcps1
 
Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please Practise
AnaAcapella
 

Recently uploaded (20)

How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
 
Asian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.pptxAsian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.pptx
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentation
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptx
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docx
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POS
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please Practise
 

1. Problem StatementWrite a C Program - using if else statements,

  • 1. 1. Problem Statement Write a C Program - using if else statements, to find the largest number among the given two integer numbers. - Instructions · Write comment to make your programs readable. · Use descriptive variables in your programs (Name of the variables shou ld show their purposes). · Ensure your code compiles without any errors/warning/deprecations · Avoid too many &amp; unnecessary usage of white spaces (newline, spaces, tabs, …) · Try to retain the original code given in the exercise, to avoi d any issues in compiling &amp; running your programs · Always test the program thoroughly, before saving/submitting exercises/project Hints/Tips #include&lt;---&gt; int main() { if ( x &gt; y ) { printf (); } else { printf (); } } Expected Output Enter the values for x and y Input: 250 350 Output: Y is large number - 350 Close 2. Problem Statement Write a C Program to extract a portion of a string from a character string.Instructions
  • 2. -Write comment to make your programs readable. -Use descriptive variables in your programs (Name of the variables shou ld show their purposes). - Ensure your code compiles without any errors/warning/deprecations - Avoid too many &amp; unnecessary usage of white spaces (newline, spaces, tabs, …) - Try to retain the original code given in the exercise, to avoid any issues in compiling &amp; running your programs - Always test the program thoroughly, before saving/submitting exercises/projectHints/Tipsinclude&lt; ---------- &gt;void main(){l=strlen(str1);if(m+n-1<l) {="" for(i="n-1," j="0;i<m+n- 1;i++,j++)" }="" else="" printf="" ("string="" extraction="" is="" not="" possible");="" ##="" expected="" output="" enter="" the="" string="" manipal="" university="" in="" jaipur="" position="" of="" required="" character:="" 9="" number="" characters="" to="" be="" extracted:="" extracted="" is:="" <="" div=""> </l)> 3.Problem Statement a) Write a C program, to find both the largest and smallest number in a list of integers using an Array. b) Write a C program, to add two matrices using an Array. c) Write a C program, to multiply two matrices using an Array.Instructions · Write comment to make your programs readable. · Use descriptive variables in your programs (Name of the variables shou ld show their purposes). · Ensure your code compiles without any errors/warning/deprecations · Avoid too many &amp; unnecessary usage of white spaces (newline, spaces, tabs, …) · Try to retain the original code given in the exercise, to avoid any issues in compiling &amp; running your programs · Always test the program thoroughly, before saving/submitting exercises/projectHints/Tipsinclude <math.h> void main() { variables; printf("n =====Matrix Addition=====n"); for(i=0;i&lt;2;i++) { for(j=0;j&lt;2;j++) { //logic } } printf("n =====Matrix Multiplication=====n");
  • 3. for(i=0;j&lt;2;j++) { for(j=0;j&lt;2;j++) { for(k=0;k&lt;2;k++) { //logic } } } }Expected Output a) Enter the max no of array elements: 4 enter the array elements 43 34 45 54 The maximum number in given array is: 54 The minimum number in given array is: 34 b) Enter elements of matrix A:1 2 3 4 Enter elements of matrix B:1 2 3 4 ===== Matrix Addition ===== 2 4 6 8 c) Enter elements of matrix A: 1 2 3 4 Enter elements of matrix B: 1 2 3 4 ===== Matrix Multiplication ===== 6 8 12 32 </math.h> Close 4. Problem Statement Write a C program to find the factorial of a given integer number using both recursive and non-recursive functions. Instructions · Write comment to make your programs readable. · Use descriptive variables in your programs (Name of the variables shou ld show their purposes). · Ensure your code compiles without any errors/warning/deprecations · Avoid too many &amp; unnecessary usage of white spaces (newline, spaces, tabs, …) · Try to retain the original code given in the exercise, to avoid any issues in compiling &amp; running your programs · Always test the program thoroughly, before saving/submitting exercises/project Hints/Tips #include&lt; ----- &gt; longint fact(int) void main() { variables; printf(“n enter an integer no:”); scanf(“%d”,&amp;n); // non-recursive
  • 4. for(i=1;i&lt;=n;i++) { //logic for factorial calculation } printf(“Factorial of %d = %d using non-recursive logic n”, n, variables); // recursive printf(“Factorial of %d = %d using recursive logic n”, n, fact(n)); } longint fact(int n) { //logic for factorial calculation } Expected Output Enter the number: 4 Factorial of 4 = 24 5. Problem Statement Write a C Program – using pointers To Swap the Values of Two Variables. Instructions · Write comment to make your programs readable. · Use descriptive variables in your programs (Name of the variables shou ld show their purposes). · Ensure your code compiles without any errors/warning/deprecations · Avoid too many &amp; unnecessary usage of white spaces (newline, spaces, tabs, …) · Try to retain the original code given in the exercise, to avoid any issues in compiling &amp; running your programs · Always test the program thoroughly, before saving/submitting exercises/project Hints/Tips # include&lt; ----- &gt; # include &lt; ------- &gt;
  • 5. main ( ) { Variables; printf ( “ Enter values of x and y: n”); scanf( “ %d%d”, x,y); *temp = ; *x= ; *y= ; printf(); } Expected Output Enter values of x and y: 10 20 x=20 y=10 6.Problem Statement Write a C program – using structures for reading the employee details like employee name, date of joining and salary and also to compute Total salary outgo for a month.Instructions -Write comment to make your programs readable. -Use descriptive variables in your programs (Name of the variables shou ld show their purposes). - Ensure your code compiles without any errors/warning/deprecations - Avoid too many &amp; unnecessary usage of white spaces (newline, spaces, tabs, …) - Try to retain the original code given in the exercise, to avoid any issues in compiling &amp; running your programs - Always test the program thoroughly, before saving/submitting exercises/projectHints/Tipsstruct personal{};main(){variables;printf (“enter number of employees”); scanf (“%d”,&amp;n);for (i=1; i&lt;=n; i++){}printf(“enter the month for total salary”);scanf(“%s”,month)for(i=1; i<n; i++)="" {="" }="" printf="" (“the="" total="" salary="" for="" giving="" month="%d”," salary);="" ##="" expected="" output="" input="" values="" chandu="" 25="" january="" 2012="" 5500="" kishore="" 20="" 5500.00="" enter="" the="" 11000.00="" <="" div=""> </n;> 7. Problem Statement
  • 6. Write a Program which behaves as prescribed in the below problem statement - Take input/output as specified - Print the expected output using the expected logic/algorithm/data - Code is structured correctly and according to the problem statement Instructions · Ensure your code compiles without any errors/warning/deprecations · Follow best practices while coding · Avoid too many &amp; unnecessary usage of white spaces (newline, spaces, tabs, ...), except to make the code readable · Use appropriate comments at appropriate places in your exercise, to explain the logic, rational, solutions, so that evaluator can know them · Try to retain the original code given in the exercise, to avoid any issues in compiling &amp; running your programs · Always test the program thoroughly, before saving/submitting exercises/project · For any issues with your exercise, contact your coach Example Inputs: variable1 = input1 variable2 = input2 /* Solution Logic according to asked problem statement */ Expected Output = As described in the problem statement Warnings · Take care of whitespace/trailing whitespace · Trim the output and avoid special characters
  • 7. · Avoid printing unnecessary values other than expected/asked output Hints/Tips int i = 0; int j = 0 ; for (int k =0; k &lt; i; k++) { printf("this is my hint logic %d", i); } 8.Problem Statement Write a C Program – to use structure within union, display the structure and length of union elements.Instructions · Write comment to make your programs readable. · Use descriptive variables in your programs (Name of the variables shou ld show their purposes). · Ensure your code compiles without any errors/warning/deprecations · Avoid too many &amp; unnecessary usage of white spaces (newline, spaces, tabs, …) · Try to retain the original code given in the exercise, to avoid any issues in compiling &amp; running your programs · Always test the program thoroughly, before saving/submitting exercises/projectHints/Tipsinclude <stdio.h> Struct hai { }; union bye { }; int main(int argc,char *argv[]) {
  • 8. Struct hai myhai; union bye mybye; …. ….. ….. }Expected Output myhai: 1 2 This is myhai mybye: 100 4197476 This is mybye </stdio.h>