SlideShare a Scribd company logo
Swadeshi MicroprocessorQuiz2020 (Start-upIndia)
C problems:
1. Anagram(Checkingif twowordsare anagrams or not andignore case)
Ex: Stressedanddesserts - yes
#include <stdio.h>
int check_anagram(char [], char []);
void main()
{
char a[100], b[100];
int flag;
printf("Enter first stringn");
gets(a);
printf("Enter second stringn");
gets(b);
flag = anagram_checker(a, b);
if (flag == 1)
printf(""%s" and "%s" are anagrams.n", a, b);
else
printf(""%s" and "%s" are not anagrams.n", a, b);
getch();
}
int anagram_checker(char s1[], char s2[])
{
int first[26] = {0}, second[26] = {0}, c = 0;
int i;
for(i=0; s1[i] != '0'; i++)
{
s1[i] = tolower(s1[i]);
}
for(i=0; s2[i] != '0'; i++)
{
s2[i] = tolower(s2[i]);
}
while (s1[c] != '0')
{
first[s1[c]-'a']++;
c++;
}
c = 0;
while (s2[c] != '0')
{
second[s2[c]-'a']++;
c++;
}
for (c = 0; c < 26; c++)
{
if (first[c] != second[c])
return 0;
}
return 1;
}
2. Convertdecimal tohexadecimal
#include <stdio.h>
int main()
{
int num;
printf("Enter decimal number: ");
scanf("%d", &num);
decimal_to_hexa(num);
return 0;
}
void decimal_to_hexa(int num){
int i=0, j = 0;
long remainder, quotient;
char hexadecimalnum[100];
quotient = num;
while (quotient != 0)
{
remainder = quotient % 16;
if (remainder < 10)
hexadecimalnum[j++] = 48 + remainder;
else
hexadecimalnum[j++] = 55 + remainder;
quotient = quotient / 16;
}
// display integer into character
for (i = j-1; i >= 0; i--)
printf("%c", hexadecimalnum[i]);
}
3. Factorial
Input- testcasesscansnumberof testcasesfor factorial,thenenterthe numberforeach
factorial
Ex-
2
2
4
Output- Factorial of twonumbers:2->2 , 4->24
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int factorial(int num)
{
// Please write your code in this function
int factorial = 1;
while(num){
factorial*=num;
num-=1;
}
return factorial;
}
int main(){
int testcases, num;
int result;
scanf("%d", &testcases);
while(testcases){
scanf("%d", &num);
result = factorial(num);
printf("%dn", result);
testcases--;
}
}

More Related Content

What's hot

Bti1022 lab sheet 8
Bti1022 lab sheet 8Bti1022 lab sheet 8
Bti1022 lab sheet 8
alish sha
 
Printing different pyramid patterns of numbers,alphabets and stars using C.
Printing different pyramid patterns of numbers,alphabets and stars using C.Printing different pyramid patterns of numbers,alphabets and stars using C.
Printing different pyramid patterns of numbers,alphabets and stars using C.
Hazrat Bilal
 
Bcsl 033 data and file structures lab s1-1
Bcsl 033 data and file structures lab s1-1Bcsl 033 data and file structures lab s1-1
Bcsl 033 data and file structures lab s1-1
Dr. Loganathan R
 
Spiral array
Spiral arraySpiral array
Spiral array
Akhilesh Agrawal
 
Let us c chapter 4 solution
Let us c chapter 4 solutionLet us c chapter 4 solution
Let us c chapter 4 solution
rohit kumar
 
Dti2143 lab sheet 9
Dti2143 lab sheet 9Dti2143 lab sheet 9
Dti2143 lab sheet 9
alish sha
 
2 d rotation
2 d rotation2 d rotation
2 d rotation
Chandu Kumare
 
Program in ‘C’ language to implement linear search using pointers
Program in ‘C’ language to implement linear search using pointersProgram in ‘C’ language to implement linear search using pointers
Program in ‘C’ language to implement linear search using pointers
Dr. Loganathan R
 
Bcsl 033 data and file structures lab s3-3
Bcsl 033 data and file structures lab s3-3Bcsl 033 data and file structures lab s3-3
Bcsl 033 data and file structures lab s3-3
Dr. Loganathan R
 
Bcsl 033 data and file structures lab s5-3
Bcsl 033 data and file structures lab s5-3Bcsl 033 data and file structures lab s5-3
Bcsl 033 data and file structures lab s5-3
Dr. Loganathan R
 
1 (1)
1 (1)1 (1)
1 (1)
Krish Na
 
C program to check leap year
C program to check leap year C program to check leap year
C program to check leap year
mohdshanu
 
Bcsl 033 data and file structures lab s3-1
Bcsl 033 data and file structures lab s3-1Bcsl 033 data and file structures lab s3-1
Bcsl 033 data and file structures lab s3-1
Dr. Loganathan R
 
C Language Programs
C Language Programs C Language Programs
C Language Programs
Mansi Tyagi
 
Prime number program in c
Prime number program in cPrime number program in c
Prime number program in c
Hitesh Kumar
 

What's hot (15)

Bti1022 lab sheet 8
Bti1022 lab sheet 8Bti1022 lab sheet 8
Bti1022 lab sheet 8
 
Printing different pyramid patterns of numbers,alphabets and stars using C.
Printing different pyramid patterns of numbers,alphabets and stars using C.Printing different pyramid patterns of numbers,alphabets and stars using C.
Printing different pyramid patterns of numbers,alphabets and stars using C.
 
Bcsl 033 data and file structures lab s1-1
Bcsl 033 data and file structures lab s1-1Bcsl 033 data and file structures lab s1-1
Bcsl 033 data and file structures lab s1-1
 
Spiral array
Spiral arraySpiral array
Spiral array
 
Let us c chapter 4 solution
Let us c chapter 4 solutionLet us c chapter 4 solution
Let us c chapter 4 solution
 
Dti2143 lab sheet 9
Dti2143 lab sheet 9Dti2143 lab sheet 9
Dti2143 lab sheet 9
 
2 d rotation
2 d rotation2 d rotation
2 d rotation
 
Program in ‘C’ language to implement linear search using pointers
Program in ‘C’ language to implement linear search using pointersProgram in ‘C’ language to implement linear search using pointers
Program in ‘C’ language to implement linear search using pointers
 
Bcsl 033 data and file structures lab s3-3
Bcsl 033 data and file structures lab s3-3Bcsl 033 data and file structures lab s3-3
Bcsl 033 data and file structures lab s3-3
 
Bcsl 033 data and file structures lab s5-3
Bcsl 033 data and file structures lab s5-3Bcsl 033 data and file structures lab s5-3
Bcsl 033 data and file structures lab s5-3
 
1 (1)
1 (1)1 (1)
1 (1)
 
C program to check leap year
C program to check leap year C program to check leap year
C program to check leap year
 
Bcsl 033 data and file structures lab s3-1
Bcsl 033 data and file structures lab s3-1Bcsl 033 data and file structures lab s3-1
Bcsl 033 data and file structures lab s3-1
 
C Language Programs
C Language Programs C Language Programs
C Language Programs
 
Prime number program in c
Prime number program in cPrime number program in c
Prime number program in c
 

Similar to Swadeshi Microprocessor Quiz 2020 (Start-up India)

Basic C Programming Lab Practice
Basic C Programming Lab PracticeBasic C Programming Lab Practice
Basic C Programming Lab Practice
Mahmud Hasan Tanvir
 
C lab manaual
C lab manaualC lab manaual
C lab manaual
manoj11manu
 
C Prog. - Strings (Updated)
C Prog. - Strings (Updated)C Prog. - Strings (Updated)
C Prog. - Strings (Updated)
vinay arora
 
C Programming lab
C Programming labC Programming lab
C Programming lab
Vikram Nandini
 
LET US C (5th EDITION) CHAPTER 2 ANSWERS
LET US C (5th EDITION) CHAPTER 2 ANSWERSLET US C (5th EDITION) CHAPTER 2 ANSWERS
LET US C (5th EDITION) CHAPTER 2 ANSWERS
KavyaSharma65
 
ADA FILE
ADA FILEADA FILE
ADA FILE
Gaurav Singh
 
C Prog - Strings
C Prog - StringsC Prog - Strings
C Prog - Strings
vinay arora
 
Chapter 8 c solution
Chapter 8 c solutionChapter 8 c solution
Chapter 8 c solution
Azhar Javed
 
Arrays
ArraysArrays
C programs Set 2
C programs Set 2C programs Set 2
C programs Set 2
Koshy Geoji
 
Data Structure in C Programming Language
Data Structure in C Programming LanguageData Structure in C Programming Language
Data Structure in C Programming Language
Arkadeep Dey
 
C programming
C programmingC programming
Cpd lecture im 207
Cpd lecture im 207Cpd lecture im 207
Cpd lecture im 207
Syed Tanveer
 
C programms
C programmsC programms
C programms
Mukund Gandrakota
 
C programming
C programmingC programming
C programming
Samsil Arefin
 
SaraPIC
SaraPICSaraPIC
SaraPIC
Sara Sahu
 
Unit 3 Input Output.pptx
Unit 3 Input Output.pptxUnit 3 Input Output.pptx
Unit 3 Input Output.pptx
Precise Mya
 
All important c programby makhan kumbhkar
All important c programby makhan kumbhkarAll important c programby makhan kumbhkar
All important c programby makhan kumbhkar
sandeep kumbhkar
 
C file
C fileC file
ภาษาซี
ภาษาซีภาษาซี
ภาษาซี
kramsri
 

Similar to Swadeshi Microprocessor Quiz 2020 (Start-up India) (20)

Basic C Programming Lab Practice
Basic C Programming Lab PracticeBasic C Programming Lab Practice
Basic C Programming Lab Practice
 
C lab manaual
C lab manaualC lab manaual
C lab manaual
 
C Prog. - Strings (Updated)
C Prog. - Strings (Updated)C Prog. - Strings (Updated)
C Prog. - Strings (Updated)
 
C Programming lab
C Programming labC Programming lab
C Programming lab
 
LET US C (5th EDITION) CHAPTER 2 ANSWERS
LET US C (5th EDITION) CHAPTER 2 ANSWERSLET US C (5th EDITION) CHAPTER 2 ANSWERS
LET US C (5th EDITION) CHAPTER 2 ANSWERS
 
ADA FILE
ADA FILEADA FILE
ADA FILE
 
C Prog - Strings
C Prog - StringsC Prog - Strings
C Prog - Strings
 
Chapter 8 c solution
Chapter 8 c solutionChapter 8 c solution
Chapter 8 c solution
 
Arrays
ArraysArrays
Arrays
 
C programs Set 2
C programs Set 2C programs Set 2
C programs Set 2
 
Data Structure in C Programming Language
Data Structure in C Programming LanguageData Structure in C Programming Language
Data Structure in C Programming Language
 
C programming
C programmingC programming
C programming
 
Cpd lecture im 207
Cpd lecture im 207Cpd lecture im 207
Cpd lecture im 207
 
C programms
C programmsC programms
C programms
 
C programming
C programmingC programming
C programming
 
SaraPIC
SaraPICSaraPIC
SaraPIC
 
Unit 3 Input Output.pptx
Unit 3 Input Output.pptxUnit 3 Input Output.pptx
Unit 3 Input Output.pptx
 
All important c programby makhan kumbhkar
All important c programby makhan kumbhkarAll important c programby makhan kumbhkar
All important c programby makhan kumbhkar
 
C file
C fileC file
C file
 
ภาษาซี
ภาษาซีภาษาซี
ภาษาซี
 

More from PARNIKA GUPTA

INTEGRATION_ASPECTS_OF_TELEMETRY_SYSTEM_FOR_A_SURVEILLANCE_UAV.pdf
INTEGRATION_ASPECTS_OF_TELEMETRY_SYSTEM_FOR_A_SURVEILLANCE_UAV.pdfINTEGRATION_ASPECTS_OF_TELEMETRY_SYSTEM_FOR_A_SURVEILLANCE_UAV.pdf
INTEGRATION_ASPECTS_OF_TELEMETRY_SYSTEM_FOR_A_SURVEILLANCE_UAV.pdf
PARNIKA GUPTA
 
Cypherock Assessment (1).pdf
Cypherock Assessment (1).pdfCypherock Assessment (1).pdf
Cypherock Assessment (1).pdf
PARNIKA GUPTA
 
IISC CPDM Task 2 Report
IISC CPDM Task 2 ReportIISC CPDM Task 2 Report
IISC CPDM Task 2 Report
PARNIKA GUPTA
 
IISC CPDM Task 1 Report
IISC CPDM Task 1 ReportIISC CPDM Task 1 Report
IISC CPDM Task 1 Report
PARNIKA GUPTA
 
Remote sensing and gis based identification of hazardous
Remote sensing and gis based identification of hazardousRemote sensing and gis based identification of hazardous
Remote sensing and gis based identification of hazardous
PARNIKA GUPTA
 
Beam forming- New Technology
Beam forming- New TechnologyBeam forming- New Technology
Beam forming- New Technology
PARNIKA GUPTA
 
LoRa application for detecting the harmful gases
LoRa application for detecting the harmful gasesLoRa application for detecting the harmful gases
LoRa application for detecting the harmful gases
PARNIKA GUPTA
 
Human Computer Interface Glove for Sign Language Translation
Human Computer Interface Glove for Sign Language TranslationHuman Computer Interface Glove for Sign Language Translation
Human Computer Interface Glove for Sign Language Translation
PARNIKA GUPTA
 
GIS application in Defense
GIS application in DefenseGIS application in Defense
GIS application in Defense
PARNIKA GUPTA
 
Transceiver System requirement specifications for 20 km range UAV video datalink
Transceiver System requirement specifications for 20 km range UAV video datalinkTransceiver System requirement specifications for 20 km range UAV video datalink
Transceiver System requirement specifications for 20 km range UAV video datalink
PARNIKA GUPTA
 
HAPTIC SUIT- Project Report(2018)
HAPTIC SUIT- Project Report(2018)HAPTIC SUIT- Project Report(2018)
HAPTIC SUIT- Project Report(2018)
PARNIKA GUPTA
 
HAPTIC SUIT presentation (2018)
HAPTIC SUIT presentation (2018) HAPTIC SUIT presentation (2018)
HAPTIC SUIT presentation (2018)
PARNIKA GUPTA
 

More from PARNIKA GUPTA (12)

INTEGRATION_ASPECTS_OF_TELEMETRY_SYSTEM_FOR_A_SURVEILLANCE_UAV.pdf
INTEGRATION_ASPECTS_OF_TELEMETRY_SYSTEM_FOR_A_SURVEILLANCE_UAV.pdfINTEGRATION_ASPECTS_OF_TELEMETRY_SYSTEM_FOR_A_SURVEILLANCE_UAV.pdf
INTEGRATION_ASPECTS_OF_TELEMETRY_SYSTEM_FOR_A_SURVEILLANCE_UAV.pdf
 
Cypherock Assessment (1).pdf
Cypherock Assessment (1).pdfCypherock Assessment (1).pdf
Cypherock Assessment (1).pdf
 
IISC CPDM Task 2 Report
IISC CPDM Task 2 ReportIISC CPDM Task 2 Report
IISC CPDM Task 2 Report
 
IISC CPDM Task 1 Report
IISC CPDM Task 1 ReportIISC CPDM Task 1 Report
IISC CPDM Task 1 Report
 
Remote sensing and gis based identification of hazardous
Remote sensing and gis based identification of hazardousRemote sensing and gis based identification of hazardous
Remote sensing and gis based identification of hazardous
 
Beam forming- New Technology
Beam forming- New TechnologyBeam forming- New Technology
Beam forming- New Technology
 
LoRa application for detecting the harmful gases
LoRa application for detecting the harmful gasesLoRa application for detecting the harmful gases
LoRa application for detecting the harmful gases
 
Human Computer Interface Glove for Sign Language Translation
Human Computer Interface Glove for Sign Language TranslationHuman Computer Interface Glove for Sign Language Translation
Human Computer Interface Glove for Sign Language Translation
 
GIS application in Defense
GIS application in DefenseGIS application in Defense
GIS application in Defense
 
Transceiver System requirement specifications for 20 km range UAV video datalink
Transceiver System requirement specifications for 20 km range UAV video datalinkTransceiver System requirement specifications for 20 km range UAV video datalink
Transceiver System requirement specifications for 20 km range UAV video datalink
 
HAPTIC SUIT- Project Report(2018)
HAPTIC SUIT- Project Report(2018)HAPTIC SUIT- Project Report(2018)
HAPTIC SUIT- Project Report(2018)
 
HAPTIC SUIT presentation (2018)
HAPTIC SUIT presentation (2018) HAPTIC SUIT presentation (2018)
HAPTIC SUIT presentation (2018)
 

Recently uploaded

DELTA V MES EMERSON EDUARDO RODRIGUES ENGINEER
DELTA V MES EMERSON EDUARDO RODRIGUES ENGINEERDELTA V MES EMERSON EDUARDO RODRIGUES ENGINEER
DELTA V MES EMERSON EDUARDO RODRIGUES ENGINEER
EMERSON EDUARDO RODRIGUES
 
comptia-security-sy0-701-exam-objectives-(5-0).pdf
comptia-security-sy0-701-exam-objectives-(5-0).pdfcomptia-security-sy0-701-exam-objectives-(5-0).pdf
comptia-security-sy0-701-exam-objectives-(5-0).pdf
foxlyon
 
UNIT 4 LINEAR INTEGRATED CIRCUITS-DIGITAL ICS
UNIT 4 LINEAR INTEGRATED CIRCUITS-DIGITAL ICSUNIT 4 LINEAR INTEGRATED CIRCUITS-DIGITAL ICS
UNIT 4 LINEAR INTEGRATED CIRCUITS-DIGITAL ICS
vmspraneeth
 
SENTIMENT ANALYSIS ON PPT AND Project template_.pptx
SENTIMENT ANALYSIS ON PPT AND Project template_.pptxSENTIMENT ANALYSIS ON PPT AND Project template_.pptx
SENTIMENT ANALYSIS ON PPT AND Project template_.pptx
b0754201
 
Determination of Equivalent Circuit parameters and performance characteristic...
Determination of Equivalent Circuit parameters and performance characteristic...Determination of Equivalent Circuit parameters and performance characteristic...
Determination of Equivalent Circuit parameters and performance characteristic...
pvpriya2
 
This study Examines the Effectiveness of Talent Procurement through the Imple...
This study Examines the Effectiveness of Talent Procurement through the Imple...This study Examines the Effectiveness of Talent Procurement through the Imple...
This study Examines the Effectiveness of Talent Procurement through the Imple...
DharmaBanothu
 
FUNDAMENTALS OF MECHANICAL ENGINEERING.pdf
FUNDAMENTALS OF MECHANICAL ENGINEERING.pdfFUNDAMENTALS OF MECHANICAL ENGINEERING.pdf
FUNDAMENTALS OF MECHANICAL ENGINEERING.pdf
EMERSON EDUARDO RODRIGUES
 
309475979-Creativity-Innovation-notes-IV-Sem-2016-pdf.pdf
309475979-Creativity-Innovation-notes-IV-Sem-2016-pdf.pdf309475979-Creativity-Innovation-notes-IV-Sem-2016-pdf.pdf
309475979-Creativity-Innovation-notes-IV-Sem-2016-pdf.pdf
Sou Tibon
 
OOPS_Lab_Manual - programs using C++ programming language
OOPS_Lab_Manual - programs using C++ programming languageOOPS_Lab_Manual - programs using C++ programming language
OOPS_Lab_Manual - programs using C++ programming language
PreethaV16
 
AI + Data Community Tour - Build the Next Generation of Apps with the Einstei...
AI + Data Community Tour - Build the Next Generation of Apps with the Einstei...AI + Data Community Tour - Build the Next Generation of Apps with the Einstei...
AI + Data Community Tour - Build the Next Generation of Apps with the Einstei...
Paris Salesforce Developer Group
 
一比一原版(爱大毕业证书)爱荷华大学毕业证如何办理
一比一原版(爱大毕业证书)爱荷华大学毕业证如何办理一比一原版(爱大毕业证书)爱荷华大学毕业证如何办理
一比一原版(爱大毕业证书)爱荷华大学毕业证如何办理
nedcocy
 
A high-Speed Communication System is based on the Design of a Bi-NoC Router, ...
A high-Speed Communication System is based on the Design of a Bi-NoC Router, ...A high-Speed Communication System is based on the Design of a Bi-NoC Router, ...
A high-Speed Communication System is based on the Design of a Bi-NoC Router, ...
DharmaBanothu
 
3rd International Conference on Artificial Intelligence Advances (AIAD 2024)
3rd International Conference on Artificial Intelligence Advances (AIAD 2024)3rd International Conference on Artificial Intelligence Advances (AIAD 2024)
3rd International Conference on Artificial Intelligence Advances (AIAD 2024)
GiselleginaGloria
 
Sri Guru Hargobind Ji - Bandi Chor Guru.pdf
Sri Guru Hargobind Ji - Bandi Chor Guru.pdfSri Guru Hargobind Ji - Bandi Chor Guru.pdf
Sri Guru Hargobind Ji - Bandi Chor Guru.pdf
Balvir Singh
 
Supermarket Management System Project Report.pdf
Supermarket Management System Project Report.pdfSupermarket Management System Project Report.pdf
Supermarket Management System Project Report.pdf
Kamal Acharya
 
Introduction to Computer Networks & OSI MODEL.ppt
Introduction to Computer Networks & OSI MODEL.pptIntroduction to Computer Networks & OSI MODEL.ppt
Introduction to Computer Networks & OSI MODEL.ppt
Dwarkadas J Sanghvi College of Engineering
 
一比一原版(osu毕业证书)美国俄勒冈州立大学毕业证如何办理
一比一原版(osu毕业证书)美国俄勒冈州立大学毕业证如何办理一比一原版(osu毕业证书)美国俄勒冈州立大学毕业证如何办理
一比一原版(osu毕业证书)美国俄勒冈州立大学毕业证如何办理
upoux
 
Tools & Techniques for Commissioning and Maintaining PV Systems W-Animations ...
Tools & Techniques for Commissioning and Maintaining PV Systems W-Animations ...Tools & Techniques for Commissioning and Maintaining PV Systems W-Animations ...
Tools & Techniques for Commissioning and Maintaining PV Systems W-Animations ...
Transcat
 
Ericsson LTE Throughput Troubleshooting Techniques.ppt
Ericsson LTE Throughput Troubleshooting Techniques.pptEricsson LTE Throughput Troubleshooting Techniques.ppt
Ericsson LTE Throughput Troubleshooting Techniques.ppt
wafawafa52
 
Beckhoff Programmable Logic Control Overview Presentation
Beckhoff Programmable Logic Control Overview PresentationBeckhoff Programmable Logic Control Overview Presentation
Beckhoff Programmable Logic Control Overview Presentation
VanTuDuong1
 

Recently uploaded (20)

DELTA V MES EMERSON EDUARDO RODRIGUES ENGINEER
DELTA V MES EMERSON EDUARDO RODRIGUES ENGINEERDELTA V MES EMERSON EDUARDO RODRIGUES ENGINEER
DELTA V MES EMERSON EDUARDO RODRIGUES ENGINEER
 
comptia-security-sy0-701-exam-objectives-(5-0).pdf
comptia-security-sy0-701-exam-objectives-(5-0).pdfcomptia-security-sy0-701-exam-objectives-(5-0).pdf
comptia-security-sy0-701-exam-objectives-(5-0).pdf
 
UNIT 4 LINEAR INTEGRATED CIRCUITS-DIGITAL ICS
UNIT 4 LINEAR INTEGRATED CIRCUITS-DIGITAL ICSUNIT 4 LINEAR INTEGRATED CIRCUITS-DIGITAL ICS
UNIT 4 LINEAR INTEGRATED CIRCUITS-DIGITAL ICS
 
SENTIMENT ANALYSIS ON PPT AND Project template_.pptx
SENTIMENT ANALYSIS ON PPT AND Project template_.pptxSENTIMENT ANALYSIS ON PPT AND Project template_.pptx
SENTIMENT ANALYSIS ON PPT AND Project template_.pptx
 
Determination of Equivalent Circuit parameters and performance characteristic...
Determination of Equivalent Circuit parameters and performance characteristic...Determination of Equivalent Circuit parameters and performance characteristic...
Determination of Equivalent Circuit parameters and performance characteristic...
 
This study Examines the Effectiveness of Talent Procurement through the Imple...
This study Examines the Effectiveness of Talent Procurement through the Imple...This study Examines the Effectiveness of Talent Procurement through the Imple...
This study Examines the Effectiveness of Talent Procurement through the Imple...
 
FUNDAMENTALS OF MECHANICAL ENGINEERING.pdf
FUNDAMENTALS OF MECHANICAL ENGINEERING.pdfFUNDAMENTALS OF MECHANICAL ENGINEERING.pdf
FUNDAMENTALS OF MECHANICAL ENGINEERING.pdf
 
309475979-Creativity-Innovation-notes-IV-Sem-2016-pdf.pdf
309475979-Creativity-Innovation-notes-IV-Sem-2016-pdf.pdf309475979-Creativity-Innovation-notes-IV-Sem-2016-pdf.pdf
309475979-Creativity-Innovation-notes-IV-Sem-2016-pdf.pdf
 
OOPS_Lab_Manual - programs using C++ programming language
OOPS_Lab_Manual - programs using C++ programming languageOOPS_Lab_Manual - programs using C++ programming language
OOPS_Lab_Manual - programs using C++ programming language
 
AI + Data Community Tour - Build the Next Generation of Apps with the Einstei...
AI + Data Community Tour - Build the Next Generation of Apps with the Einstei...AI + Data Community Tour - Build the Next Generation of Apps with the Einstei...
AI + Data Community Tour - Build the Next Generation of Apps with the Einstei...
 
一比一原版(爱大毕业证书)爱荷华大学毕业证如何办理
一比一原版(爱大毕业证书)爱荷华大学毕业证如何办理一比一原版(爱大毕业证书)爱荷华大学毕业证如何办理
一比一原版(爱大毕业证书)爱荷华大学毕业证如何办理
 
A high-Speed Communication System is based on the Design of a Bi-NoC Router, ...
A high-Speed Communication System is based on the Design of a Bi-NoC Router, ...A high-Speed Communication System is based on the Design of a Bi-NoC Router, ...
A high-Speed Communication System is based on the Design of a Bi-NoC Router, ...
 
3rd International Conference on Artificial Intelligence Advances (AIAD 2024)
3rd International Conference on Artificial Intelligence Advances (AIAD 2024)3rd International Conference on Artificial Intelligence Advances (AIAD 2024)
3rd International Conference on Artificial Intelligence Advances (AIAD 2024)
 
Sri Guru Hargobind Ji - Bandi Chor Guru.pdf
Sri Guru Hargobind Ji - Bandi Chor Guru.pdfSri Guru Hargobind Ji - Bandi Chor Guru.pdf
Sri Guru Hargobind Ji - Bandi Chor Guru.pdf
 
Supermarket Management System Project Report.pdf
Supermarket Management System Project Report.pdfSupermarket Management System Project Report.pdf
Supermarket Management System Project Report.pdf
 
Introduction to Computer Networks & OSI MODEL.ppt
Introduction to Computer Networks & OSI MODEL.pptIntroduction to Computer Networks & OSI MODEL.ppt
Introduction to Computer Networks & OSI MODEL.ppt
 
一比一原版(osu毕业证书)美国俄勒冈州立大学毕业证如何办理
一比一原版(osu毕业证书)美国俄勒冈州立大学毕业证如何办理一比一原版(osu毕业证书)美国俄勒冈州立大学毕业证如何办理
一比一原版(osu毕业证书)美国俄勒冈州立大学毕业证如何办理
 
Tools & Techniques for Commissioning and Maintaining PV Systems W-Animations ...
Tools & Techniques for Commissioning and Maintaining PV Systems W-Animations ...Tools & Techniques for Commissioning and Maintaining PV Systems W-Animations ...
Tools & Techniques for Commissioning and Maintaining PV Systems W-Animations ...
 
Ericsson LTE Throughput Troubleshooting Techniques.ppt
Ericsson LTE Throughput Troubleshooting Techniques.pptEricsson LTE Throughput Troubleshooting Techniques.ppt
Ericsson LTE Throughput Troubleshooting Techniques.ppt
 
Beckhoff Programmable Logic Control Overview Presentation
Beckhoff Programmable Logic Control Overview PresentationBeckhoff Programmable Logic Control Overview Presentation
Beckhoff Programmable Logic Control Overview Presentation
 

Swadeshi Microprocessor Quiz 2020 (Start-up India)

  • 1. Swadeshi MicroprocessorQuiz2020 (Start-upIndia) C problems: 1. Anagram(Checkingif twowordsare anagrams or not andignore case) Ex: Stressedanddesserts - yes #include <stdio.h> int check_anagram(char [], char []); void main() { char a[100], b[100]; int flag; printf("Enter first stringn"); gets(a); printf("Enter second stringn"); gets(b); flag = anagram_checker(a, b); if (flag == 1) printf(""%s" and "%s" are anagrams.n", a, b); else printf(""%s" and "%s" are not anagrams.n", a, b); getch(); } int anagram_checker(char s1[], char s2[]) { int first[26] = {0}, second[26] = {0}, c = 0; int i; for(i=0; s1[i] != '0'; i++) { s1[i] = tolower(s1[i]); } for(i=0; s2[i] != '0'; i++) { s2[i] = tolower(s2[i]); } while (s1[c] != '0') { first[s1[c]-'a']++; c++; } c = 0; while (s2[c] != '0') { second[s2[c]-'a']++; c++; } for (c = 0; c < 26; c++) { if (first[c] != second[c]) return 0; } return 1; }
  • 2. 2. Convertdecimal tohexadecimal #include <stdio.h> int main() { int num; printf("Enter decimal number: "); scanf("%d", &num); decimal_to_hexa(num); return 0; } void decimal_to_hexa(int num){ int i=0, j = 0; long remainder, quotient; char hexadecimalnum[100]; quotient = num; while (quotient != 0) { remainder = quotient % 16; if (remainder < 10) hexadecimalnum[j++] = 48 + remainder; else hexadecimalnum[j++] = 55 + remainder; quotient = quotient / 16; } // display integer into character for (i = j-1; i >= 0; i--) printf("%c", hexadecimalnum[i]); } 3. Factorial Input- testcasesscansnumberof testcasesfor factorial,thenenterthe numberforeach factorial Ex- 2 2 4 Output- Factorial of twonumbers:2->2 , 4->24 #include <stdio.h> #include <stdlib.h> #include <string.h> int factorial(int num) { // Please write your code in this function int factorial = 1; while(num){ factorial*=num; num-=1; } return factorial; } int main(){
  • 3. int testcases, num; int result; scanf("%d", &testcases); while(testcases){ scanf("%d", &num); result = factorial(num); printf("%dn", result); testcases--; } }