0% found this document useful (0 votes)
5 views4 pages

A.A Program C

Uploaded by

22ita58
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views4 pages

A.A Program C

Uploaded by

22ita58
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

#include <stdio.

h>

#define pf printf

#define sf scanf

void main(){

int n,i;

pf("enter a number of arr: ");

sf("%d",&n);

int arr[n];

for(i=0;i<n;i++)

sf("%d",&arr[i]);

int largest=arr[0];

for(i=1;i<n;i++)

if(largest<arr[i]){

largest=arr[i]; }

pf("ans: %d",largest);

#include <stdio.h>

#define pf printf

#define sf scanf

int main() {

int d,i;

pf("enter: ");

sf("%c",&d);
char vow[10]={'a','e','i','o','u'};

for(i=0;i<10;i++){

if(vow[i]==d){

pf("it is a vowel");

return 0;

pf("it is consonants");

#include <stdio.h>

#define pf printf

#define sf scanf

int main() {

int a, i;

pf("Enter the number of elements: ");

sf("%d", &a);

int arr[a];

int sum = 0, avg;

pf("Enter numbers:\n");

for (i = 0; i < a; i++) {

sf("%d", &arr[i]);

for (i = 0; i < a; i++) {

sum += arr[i];

}
avg = sum / a;

pf("Sum = %d\n", sum);

pf("Avg = %d\n", avg);

return 0;

Using string funtion

#include <stdio.h>

#include<string.h>

#define pf printf

#define sf scanf

void main(){

char a [20],n[20]=" how are you",c[20];

pf("enter your name: ");

sf("%s",&a);

pf("Hi! %s 😃\n",a);

pf("%d\n",strlen(a));

strcat(a,n);

pf("%s\n",a);

strcpy(c,a);

pf("%s\n",c);

pf("%d\n",strcmp(a,n));

pf("%d\n",strcmp(a,c);

}
#include <stdio.h>

#include<string.h>

#define pf printf

#define sf scanf

void main (){

char n[20];

int i,s;

pf("enter your name: ");

gets(n);

puts(n);

s=strlen(n);

for(i=0;i<s;i++)

// pf("%c\n",n[i]);

if(n[i]=="a"||n[i]=="e"||){

pf("as a");

You might also like