SlideShare una empresa de Scribd logo
1 de 13
C Programming codes for the class Assignment
Problem 1
Write a program in C to initialize an array and then display it in reverse order.
We can solve this problem in two way
1.Using for loop
2. Using string type array
#include<stdio.h>
int main(void)
{
int s1[100];
int i,n,count=0;
printf("Enter size of array:n");
scanf("%d",&n);
printf("n Enter Numbers:n");
for(i=0; i<n ;i++)
{
printf("Element %dn ",count++);
scanf("%d ",&s1[i]);
}
printf("n Reverse is :n");
for(i=n-1;i>=0;i--)
{
printf("%d ",s1[i]);
}
return 0;
}
Using String type array
#include<stdio.h>
#include<string.h>
int main(void)
{
char s1[100];
printf("Enter a string:n");
gets(s1);
printf("n Reverse of string is %s
nn",strrev(s1));
return 0;
}
Notice that String type array
(string) works only if the data type
is char type. Otherwise it may go
wrong.
Problem-2
Write a Program in C to store n element in an array from
user and then find the maximum and minimum element.
Solve the ProblemUsing for loop and like the example in the book at page143
include <stdio.h>
#include <conio.h>
int main()
{
int s[1000];
int i,n,min,max;
int a=1;
printf("Enter size of the array :n ");
scanf("%d",&n);
printf("Enter elements in array :n ");
for(i=0; i<n; i++)
{
printf("Element %dn",a++);
scanf("%d",&s[i]);
}
min=max=s[0];
for(i=1; i<n; i++)
{
if(min>s[i])
min=s[i];
if(max<s[i])
max=s[i];
}
printf("nMinimum of array is : %d",min);
printf("nMaximum of array is : %dn",max);
return 0;
}
Problem-3
Write a program in C to store n element in an array from
user and then store even and odd in two different array
This problem may solve in two ways
Way-1: Using only for loop
Way-2 Using a conditional function
#include<stdio.h>
#include<conio.h>
int main()
{
int a[10000],b[10000],c[20000],i,n;
int l=0;
printf("Enter size of the array :n ");
scanf("%d", &n);
printf("Enter elements in array :n ");
for(i=0; i<n; i++)
{
printf("Element %dn",l++);
scanf("%d",&a[i]);
}
printf("n Original Array:n");
for(i=0; i<n; i++)
printf("%d ",a[i]);
for(i=0; i<n; i++)
b[i]=a[i];
printf("n Even n");
for(i=0;i<n;i++)
{
if(a[i]%2==0)
printf("%d ",b[i]);
}
for(i=0; i<n; i++)
c[i]=a[i];
printf("n Odd n");
for(i=0;i<n;i++)
{
if(a[i]%2!=0)
printf("%d ",c[i]);
}
return 0;
}
#include <stdio.h>
#include <conio.h>
con(int *a,int n)
{
int i;
for(i=0; i<n; i++)
{
printf("%d ",a[i]);
}
}
int main()
{
int a[10000],b[10000],c[20000],i,j,k,n;
int l=0;
printf("Enter size of the array :n ");
scanf("%d", &n);
printf("Enter elements in array :n ");
for(i=0; i<n; i++)
{
printf("Element %dn",l++);
scanf("%d",&a[i]);
}
printf("n original array n");
con(a,n);
j=k=0;
for(i=0; i<n; i++)
{
if(a[i]%2==0)
b[j++]=a[i];
else
c[k++]=a[i];
}
printf(" n Even array n");
con (b,j);
printf(" n odd array n");
con(c,k);
return 0;
}
C programming codes for the class assignment

Más contenido relacionado

La actualidad más candente

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 pointersDr. Loganathan R
 
C program to add n numbers
C program to add n numbers C program to add n numbers
C program to add n numbers mohdshanu
 
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-3Dr. Loganathan R
 
Bcsl 033 data and file structures lab s2-3
Bcsl 033 data and file structures lab s2-3Bcsl 033 data and file structures lab s2-3
Bcsl 033 data and file structures lab s2-3Dr. Loganathan R
 
Bcsl 033 data and file structures lab s3-2
Bcsl 033 data and file structures lab s3-2Bcsl 033 data and file structures lab s3-2
Bcsl 033 data and file structures lab s3-2Dr. Loganathan R
 
Implement a queue using two stacks.
Implement a queue using two stacks.Implement a queue using two stacks.
Implement a queue using two stacks.Dr. Loganathan R
 
C Language Programs
C Language Programs C Language Programs
C Language Programs Mansi Tyagi
 
Write a program to check a given number is prime or not
Write a program to check a given number is prime or notWrite a program to check a given number is prime or not
Write a program to check a given number is prime or notaluavi
 
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-1Dr. Loganathan R
 
Program to reflecta triangle
Program to reflecta triangleProgram to reflecta triangle
Program to reflecta triangleTanya Makkar
 
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-3Dr. Loganathan R
 

La actualidad más candente (16)

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
 
C program to add n numbers
C program to add n numbers C program to add n numbers
C program to add n numbers
 
SaraPIC
SaraPICSaraPIC
SaraPIC
 
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 s2-3
Bcsl 033 data and file structures lab s2-3Bcsl 033 data and file structures lab s2-3
Bcsl 033 data and file structures lab s2-3
 
Bcsl 033 data and file structures lab s3-2
Bcsl 033 data and file structures lab s3-2Bcsl 033 data and file structures lab s3-2
Bcsl 033 data and file structures lab s3-2
 
Implement a queue using two stacks.
Implement a queue using two stacks.Implement a queue using two stacks.
Implement a queue using two stacks.
 
C Language Programs
C Language Programs C Language Programs
C Language Programs
 
week-22x
week-22xweek-22x
week-22x
 
1 (1)
1 (1)1 (1)
1 (1)
 
Write a program to check a given number is prime or not
Write a program to check a given number is prime or notWrite a program to check a given number is prime or not
Write a program to check a given number is prime or not
 
Progr2
Progr2Progr2
Progr2
 
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
 
Program to reflecta triangle
Program to reflecta triangleProgram to reflecta triangle
Program to reflecta triangle
 
C coding#1
C   coding#1C   coding#1
C coding#1
 
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
 

Similar a C programming codes for the class assignment

Basic C Programming Lab Practice
Basic C Programming Lab PracticeBasic C Programming Lab Practice
Basic C Programming Lab PracticeMahmud Hasan Tanvir
 
Chapter 8 c solution
Chapter 8 c solutionChapter 8 c solution
Chapter 8 c solutionAzhar Javed
 
All important c programby makhan kumbhkar
All important c programby makhan kumbhkarAll important c programby makhan kumbhkar
All important c programby makhan kumbhkarsandeep kumbhkar
 
Data Structure using C
Data Structure using CData Structure using C
Data Structure using CBilal Mirza
 
Basic c programs updated on 31.8.2020
Basic c programs updated on 31.8.2020Basic c programs updated on 31.8.2020
Basic c programs updated on 31.8.2020vrgokila
 
PCA-2 Programming and Solving 2nd Sem.pdf
PCA-2 Programming and Solving 2nd Sem.pdfPCA-2 Programming and Solving 2nd Sem.pdf
PCA-2 Programming and Solving 2nd Sem.pdfAshutoshprasad27
 
PCA-2 Programming and Solving 2nd Sem.docx
PCA-2 Programming and Solving 2nd Sem.docxPCA-2 Programming and Solving 2nd Sem.docx
PCA-2 Programming and Solving 2nd Sem.docxAshutoshprasad27
 
Computer programming subject notes. Quick easy notes for C Programming.Cheat ...
Computer programming subject notes. Quick easy notes for C Programming.Cheat ...Computer programming subject notes. Quick easy notes for C Programming.Cheat ...
Computer programming subject notes. Quick easy notes for C Programming.Cheat ...DR B.Surendiran .
 
Practical write a c program to reverse a given number
Practical write a c program to reverse a given numberPractical write a c program to reverse a given number
Practical write a c program to reverse a given numberMainak Sasmal
 
Practical write a c program to reverse a given number
Practical write a c program to reverse a given numberPractical write a c program to reverse a given number
Practical write a c program to reverse a given numberMainak Sasmal
 
Common problems solving using c
Common problems solving using cCommon problems solving using c
Common problems solving using cArghodeepPaul
 

Similar a C programming codes for the class assignment (20)

Basic C Programming Lab Practice
Basic C Programming Lab PracticeBasic C Programming Lab Practice
Basic C Programming Lab Practice
 
Chapter 8 c solution
Chapter 8 c solutionChapter 8 c solution
Chapter 8 c solution
 
All important c programby makhan kumbhkar
All important c programby makhan kumbhkarAll important c programby makhan kumbhkar
All important c programby makhan kumbhkar
 
C-programs
C-programsC-programs
C-programs
 
Data Structure using C
Data Structure using CData Structure using C
Data Structure using C
 
Basic c programs updated on 31.8.2020
Basic c programs updated on 31.8.2020Basic c programs updated on 31.8.2020
Basic c programs updated on 31.8.2020
 
PCA-2 Programming and Solving 2nd Sem.pdf
PCA-2 Programming and Solving 2nd Sem.pdfPCA-2 Programming and Solving 2nd Sem.pdf
PCA-2 Programming and Solving 2nd Sem.pdf
 
PCA-2 Programming and Solving 2nd Sem.docx
PCA-2 Programming and Solving 2nd Sem.docxPCA-2 Programming and Solving 2nd Sem.docx
PCA-2 Programming and Solving 2nd Sem.docx
 
Computer programming subject notes. Quick easy notes for C Programming.Cheat ...
Computer programming subject notes. Quick easy notes for C Programming.Cheat ...Computer programming subject notes. Quick easy notes for C Programming.Cheat ...
Computer programming subject notes. Quick easy notes for C Programming.Cheat ...
 
C file
C fileC file
C file
 
C lab manaual
C lab manaualC lab manaual
C lab manaual
 
array.ppt
array.pptarray.ppt
array.ppt
 
C Programming
C ProgrammingC Programming
C Programming
 
C programs
C programsC programs
C programs
 
ADA FILE
ADA FILEADA FILE
ADA FILE
 
Practical write a c program to reverse a given number
Practical write a c program to reverse a given numberPractical write a c program to reverse a given number
Practical write a c program to reverse a given number
 
Practical write a c program to reverse a given number
Practical write a c program to reverse a given numberPractical write a c program to reverse a given number
Practical write a c program to reverse a given number
 
2D array
2D array2D array
2D array
 
C lab
C labC lab
C lab
 
Common problems solving using c
Common problems solving using cCommon problems solving using c
Common problems solving using c
 

Último

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.pdfQucHHunhnh
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAssociation for Project Management
 
The byproduct of sericulture in different industries.pptx
The byproduct of sericulture in different industries.pptxThe byproduct of sericulture in different industries.pptx
The byproduct of sericulture in different industries.pptxShobhayan Kirtania
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionSafetyChain Software
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room servicediscovermytutordmt
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfchloefrazer622
 
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...anjaliyadav012327
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDThiyagu K
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
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 ConsultingTechSoup
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 

Último (20)

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
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across Sectors
 
The byproduct of sericulture in different industries.pptx
The byproduct of sericulture in different industries.pptxThe byproduct of sericulture in different industries.pptx
The byproduct of sericulture in different industries.pptx
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory Inspection
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room service
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdf
 
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SD
 
Advance Mobile Application Development class 07
Advance Mobile Application Development class 07Advance Mobile Application Development class 07
Advance Mobile Application Development class 07
 
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
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
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 

C programming codes for the class assignment

  • 1. C Programming codes for the class Assignment Problem 1 Write a program in C to initialize an array and then display it in reverse order.
  • 2. We can solve this problem in two way 1.Using for loop 2. Using string type array
  • 3. #include<stdio.h> int main(void) { int s1[100]; int i,n,count=0; printf("Enter size of array:n"); scanf("%d",&n); printf("n Enter Numbers:n"); for(i=0; i<n ;i++) { printf("Element %dn ",count++); scanf("%d ",&s1[i]); } printf("n Reverse is :n"); for(i=n-1;i>=0;i--) { printf("%d ",s1[i]); } return 0; }
  • 4. Using String type array #include<stdio.h> #include<string.h> int main(void) { char s1[100]; printf("Enter a string:n"); gets(s1); printf("n Reverse of string is %s nn",strrev(s1)); return 0; } Notice that String type array (string) works only if the data type is char type. Otherwise it may go wrong.
  • 5. Problem-2 Write a Program in C to store n element in an array from user and then find the maximum and minimum element.
  • 6. Solve the ProblemUsing for loop and like the example in the book at page143 include <stdio.h> #include <conio.h> int main() { int s[1000]; int i,n,min,max; int a=1; printf("Enter size of the array :n "); scanf("%d",&n); printf("Enter elements in array :n "); for(i=0; i<n; i++) { printf("Element %dn",a++); scanf("%d",&s[i]); } min=max=s[0]; for(i=1; i<n; i++) { if(min>s[i]) min=s[i]; if(max<s[i]) max=s[i]; } printf("nMinimum of array is : %d",min); printf("nMaximum of array is : %dn",max); return 0; }
  • 7. Problem-3 Write a program in C to store n element in an array from user and then store even and odd in two different array
  • 8. This problem may solve in two ways Way-1: Using only for loop Way-2 Using a conditional function
  • 9. #include<stdio.h> #include<conio.h> int main() { int a[10000],b[10000],c[20000],i,n; int l=0; printf("Enter size of the array :n "); scanf("%d", &n); printf("Enter elements in array :n "); for(i=0; i<n; i++) { printf("Element %dn",l++); scanf("%d",&a[i]); } printf("n Original Array:n"); for(i=0; i<n; i++) printf("%d ",a[i]); for(i=0; i<n; i++) b[i]=a[i]; printf("n Even n"); for(i=0;i<n;i++) { if(a[i]%2==0) printf("%d ",b[i]); }
  • 10. for(i=0; i<n; i++) c[i]=a[i]; printf("n Odd n"); for(i=0;i<n;i++) { if(a[i]%2!=0) printf("%d ",c[i]); } return 0; }
  • 11. #include <stdio.h> #include <conio.h> con(int *a,int n) { int i; for(i=0; i<n; i++) { printf("%d ",a[i]); } } int main() { int a[10000],b[10000],c[20000],i,j,k,n; int l=0; printf("Enter size of the array :n "); scanf("%d", &n); printf("Enter elements in array :n "); for(i=0; i<n; i++) { printf("Element %dn",l++); scanf("%d",&a[i]); }
  • 12. printf("n original array n"); con(a,n); j=k=0; for(i=0; i<n; i++) { if(a[i]%2==0) b[j++]=a[i]; else c[k++]=a[i]; } printf(" n Even array n"); con (b,j); printf(" n odd array n"); con(c,k); return 0; }