Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions aslam1.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#include<stdio.h>
void main()
{
int a,b,c;
printf("enter the num");
scanf("%d%d",a,b);
c=a+b;
printf("sum is%d",c);
getch();
}
29 changes: 29 additions & 0 deletions r.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#include <stdio.h>
#include <string.h>

void reverse(char [], int, int);
int main()
{
char str1[20];
int size;

printf("Enter a string to reverse: ");
scanf("%s", str1);
size = strlen(str1);
reverse(str1, 0, size - 1);
printf("The string after reversing is: %s\n", str1);
return 0;
}

void reverse(char str1[], int index, int size)
{
char temp;
temp = str1[index];
str1[index] = str1[size - index];
str1[size - index] = temp;
if (index == size / 2)
{
return;
}
reverse(str1, index + 1, size);
}