Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 2

Government Arts and Science College

Computer Science
TECHNOWARE - 2023
I.Find the error.
1. #include<stdio.h>
#inclued<conio.h>
void main()
{
int a;
float b;
char c;
printf("Enter values of a, b and c\n"):
if (scanf("%d %f %c", &a, &b &c) == 3)
prinf("a = %d b = %f c = %c\n , a, b, c);
else
printf("Error in input.\n");
getch();
}
2. #include <stdio.h>
#include<conio.h>
#include <ctype.h>
void Main()
{
char character;
printf("Press any key\n");
character = get char();
if (isalpha(character) > 0)
printf("The character is a letter.");
else:
if (isdigit (character) > 0)
printf("The character is a digit.’);
else
printf("The character is not alphanumeric.");
getch;
}
Government Arts and Science College
Computer Science
TECHNOWARE - 2023

3. #include <iostraem.h>
#include<conio.h>
void main()
{
int i, n;
floatarr[100];
cout << "Enter total number of elements(1 to 100): ";
cin >> n;
cout << endl;
for(i = 0; i < n: ++i)
{
cout << "Enter Number " << i + 1 << " : ";
cin >> arr[i];
}
for(i = 1;i < n; ++i)
{
if(arr[0] < arr[i])
arr[0] = arr[i]
cout << endl << "Largest element = " << arr[0];
getch();
}
4. #include <iostream.h>
#include<conio.h>
voidmain()
{
int a = 5, b = 10. temp;
cout << "Before swapping." << endl;
cout << "a = " >> a << ", b = " << b << endl;
temp = a; a = b;
b = tem;
cout << "\nAfter swapping." << endl;
cout << "a = " << a << ", b = " << b << endl:
getch();
}

You might also like